{"action":"created","issue":{"url":"https://api.github.com/repos/opentk/opentk/issues/234","labels_url":"https://api.github.com/repos/opentk/opentk/issues/234/labels{/name}","comments_url":"https://api.github.com/repos/opentk/opentk/issues/234/comments","events_url":"https://api.github.com/repos/opentk/opentk/issues/234/events","html_url":"https://github.com/opentk/opentk/pull/234","id":62762582,"number":234,"title":"Allow using OpenGL ES3 with Angle and extract a Direct3D shared handle","user":{"login":"l3m","id":230547,"avatar_url":"https://avatars.githubusercontent.com/u/230547?v=3","gravatar_id":"","url":"https://api.github.com/users/l3m","html_url":"https://github.com/l3m","followers_url":"https://api.github.com/users/l3m/followers","following_url":"https://api.github.com/users/l3m/following{/other_user}","gists_url":"https://api.github.com/users/l3m/gists{/gist_id}","starred_url":"https://api.github.com/users/l3m/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/l3m/subscriptions","organizations_url":"https://api.github.com/users/l3m/orgs","repos_url":"https://api.github.com/users/l3m/repos","events_url":"https://api.github.com/users/l3m/events{/privacy}","received_events_url":"https://api.github.com/users/l3m/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/opentk/opentk/labels/enhancement","name":"enhancement","color":"84b6eb"},{"url":"https://api.github.com/repos/opentk/opentk/labels/opengl%20es","name":"opengl es","color":"006b75"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-03-18T18:07:54Z","updated_at":"2015-04-07T14:27:29Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/opentk/opentk/pulls/234","html_url":"https://github.com/opentk/opentk/pull/234","diff_url":"https://github.com/opentk/opentk/pull/234.diff","patch_url":"https://github.com/opentk/opentk/pull/234.patch"},"body":"This is an updated version of my previous pull request  #230.\r\n\r\nThese changes improve interoperability of OpenTK with Angle as rendering backed. Specifically, it allows a user to render with OpenGL|ES3 into offscreen surfaces, and retrieve the Direct3D-shared handles (texture pointers) of those surfaces for interop with Wpf (Windows Presentation Foundation) Guis or other frameworks that use Direct3D.\r\n\r\nI added ```GraphicsContextFlags``` that allow a user to request an Angle-backed context with different backends as well as an ```Offscreen``` flag. If an EglContext is created with ```Offscreen```, the default surface is a PbufferSurface, not a WindowSurface. \r\n\r\nI found the way that OpenTK currently deals with contexts a bit confusing, and tried to keep changes to existing classes minimal. \r\n\r\nTherefore, I created an ```AngleInterop``` class where some references for the contexts that use Angle are stored. This allows a user to request shared handles for interop purposes, create additional surfaces for offscreen rendering, and retrieve their pointers.\r\n\r\n\r\nI am happy to update or restructure my code if someone knows a better way to achieve this. \r\n\r\n\r\nA demo using these changes can be found [here](https://github.com/l3m/wpf-gles).\r\n\r\n![2015-03-18 18_50_09-wpf gl_es demo](https://cloud.githubusercontent.com/assets/230547/6715571/b2821daa-cd9f-11e4-8bdd-6cf85d58e664.png)\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/opentk/opentk/issues/comments/90585029","html_url":"https://github.com/opentk/opentk/pull/234#issuecomment-90585029","issue_url":"https://api.github.com/repos/opentk/opentk/issues/234","id":90585029,"user":{"login":"l3m","id":230547,"avatar_url":"https://avatars.githubusercontent.com/u/230547?v=3","gravatar_id":"","url":"https://api.github.com/users/l3m","html_url":"https://github.com/l3m","followers_url":"https://api.github.com/users/l3m/followers","following_url":"https://api.github.com/users/l3m/following{/other_user}","gists_url":"https://api.github.com/users/l3m/gists{/gist_id}","starred_url":"https://api.github.com/users/l3m/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/l3m/subscriptions","organizations_url":"https://api.github.com/users/l3m/orgs","repos_url":"https://api.github.com/users/l3m/repos","events_url":"https://api.github.com/users/l3m/events{/privacy}","received_events_url":"https://api.github.com/users/l3m/received_events","type":"User","site_admin":false},"created_at":"2015-04-07T14:27:29Z","updated_at":"2015-04-07T14:27:29Z","body":"I updated the prq to be much less intrusive. It also does no longer interfere in windows-platform specific stuff. Instead, I created an angle factory and use it where appropriate. \r\n\r\nA user would instantiate an AngleOffscreenRendering instance (similar to when using a GLControl). Resizing and getting a Direct3D texture pointer (shared handles) are handled over this AngleOffscreenRendering instance, and the GraphicsContext and WindowInfo instances are exposed on it, too. \r\n\r\nI also updated my wpf demo to use the latest version - I also added all dependencies there to the repo, so you can checkout and it should just work. \r\n\r\n\r\n"}}