{"action":"created","issue":{"url":"https://api.github.com/repos/emscripten-ports/SDL2/issues/48","repository_url":"https://api.github.com/repos/emscripten-ports/SDL2","labels_url":"https://api.github.com/repos/emscripten-ports/SDL2/issues/48/labels{/name}","comments_url":"https://api.github.com/repos/emscripten-ports/SDL2/issues/48/comments","events_url":"https://api.github.com/repos/emscripten-ports/SDL2/issues/48/events","html_url":"https://github.com/emscripten-ports/SDL2/issues/48","id":258232600,"number":48,"title":"Cannot create transparent GL context","user":{"login":"mchiasson","id":961637,"avatar_url":"https://avatars1.githubusercontent.com/u/961637?v=4","gravatar_id":"","url":"https://api.github.com/users/mchiasson","html_url":"https://github.com/mchiasson","followers_url":"https://api.github.com/users/mchiasson/followers","following_url":"https://api.github.com/users/mchiasson/following{/other_user}","gists_url":"https://api.github.com/users/mchiasson/gists{/gist_id}","starred_url":"https://api.github.com/users/mchiasson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mchiasson/subscriptions","organizations_url":"https://api.github.com/users/mchiasson/orgs","repos_url":"https://api.github.com/users/mchiasson/repos","events_url":"https://api.github.com/users/mchiasson/events{/privacy}","received_events_url":"https://api.github.com/users/mchiasson/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2017-09-16T13:48:13Z","updated_at":"2017-09-18T19:15:17Z","closed_at":null,"author_association":"NONE","body":"With this code, I would expect that I would be able to create a transparent overlay\r\n```C++\r\n    SDL_GL_SetAttribute(SDL_GL_RED_SIZE, 8);\r\n    SDL_GL_SetAttribute(SDL_GL_GREEN_SIZE, 8);\r\n    SDL_GL_SetAttribute(SDL_GL_BLUE_SIZE, 8);\r\n    SDL_GL_SetAttribute(SDL_GL_ALPHA_SIZE, 8);\r\n    context = SDL_GL_CreateContext(window);\r\n```\r\nUnfortunately, it remains opaque.\r\n\r\nMy current work around is to use `<emscripten/html5.h>` and do the following instead:\r\n```C++\r\n    EmscriptenWebGLContextAttributes attr;\r\n    emscripten_webgl_init_context_attributes(&attr);\r\n    attr.alpha = 1;\r\n    attr.depth = attr.stencil = attr.antialias = attr.preserveDrawingBuffer = attr.preferLowPowerToHighPerformance = attr.failIfMajorPerformanceCaveat = 0;\r\n    attr.enableExtensionsByDefault = 1;\r\n    attr.premultipliedAlpha = 0;\r\n    attr.majorVersion = 1;\r\n    attr.minorVersion = 0;\r\n    EMSCRIPTEN_WEBGL_CONTEXT_HANDLE ctx = emscripten_webgl_create_context(0, &attr);\r\n    emscripten_webgl_make_context_current(ctx);\r\n```"},"comment":{"url":"https://api.github.com/repos/emscripten-ports/SDL2/issues/comments/330327227","html_url":"https://github.com/emscripten-ports/SDL2/issues/48#issuecomment-330327227","issue_url":"https://api.github.com/repos/emscripten-ports/SDL2/issues/48","id":330327227,"user":{"login":"juj","id":225351,"avatar_url":"https://avatars2.githubusercontent.com/u/225351?v=4","gravatar_id":"","url":"https://api.github.com/users/juj","html_url":"https://github.com/juj","followers_url":"https://api.github.com/users/juj/followers","following_url":"https://api.github.com/users/juj/following{/other_user}","gists_url":"https://api.github.com/users/juj/gists{/gist_id}","starred_url":"https://api.github.com/users/juj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/juj/subscriptions","organizations_url":"https://api.github.com/users/juj/orgs","repos_url":"https://api.github.com/users/juj/repos","events_url":"https://api.github.com/users/juj/events{/privacy}","received_events_url":"https://api.github.com/users/juj/received_events","type":"User","site_admin":false},"created_at":"2017-09-18T19:15:17Z","updated_at":"2017-09-18T19:15:17Z","author_association":"CONTRIBUTOR","body":"Acknowledged the problem. There's no issue to fix in SDL side, but we'll need to add this in Emscripten EGL side. We are currently in the middle of a big multithreading-enable flow of development in Emscripten, which rewrites EGL support there, see https://github.com/kripken/emscripten/pull/5580. After that PR lands, we can then directly hook in support to read the context attributes - the previous code used a bit clumsy initialization code due to historical reasons. @mchiasson, if you are not in a rush and the workaround you are using is satisfying, that's the best way to go for now."}}
{"actor":{"display_login":"juj"}}