SDL2/EGL: handle GL context attributes (#7227) #7242
Conversation
alpha: false, | ||
depth: true, | ||
stencil: true, | ||
antialias: true, | ||
|
kripken
Oct 9, 2018
Member
Are these defaults set according to EGL's defaults, or WebGL, or just based on the previous defaults we had here? Please add a comment on this, as e.g. the eglChooseConfig docs mention depth and stencil should be false, so we should document the difference there.
Are these defaults set according to EGL's defaults, or WebGL, or just based on the previous defaults we had here? Please add a comment on this, as e.g. the eglChooseConfig docs mention depth and stencil should be false, so we should document the difference there.
Beuc
Oct 9, 2018
Author
Contributor
Right, I just avoided changing the previous behavior, I'll add a comment.
Would you rather we follow EGL's defaults though?
Right, I just avoided changing the previous behavior, I'll add a comment.
Would you rather we follow EGL's defaults though?
kripken
Oct 10, 2018
Member
Let's leave that for a later PR - I'm not sure what's the best thing.
Let's leave that for a later PR - I'm not sure what's the best thing.
var param = {{{ makeGetValue('attribList', '0', 'i32') }}}; | ||
if (param == 0x3021 /*EGL_ALPHA_SIZE*/) { | ||
var alphaSize = {{{ makeGetValue('attribList', '4', 'i32') }}}; | ||
EGL.alpha = (alphaSize > 0); |
kripken
Oct 9, 2018
Member
indentation looks wrong here
indentation looks wrong here
@@ -1247,6 +1247,7 @@ def test_webgl_context_attributes(self): | |||
# perform tests with attributes activated | |||
self.btest('test_webgl_context_attributes_glut.c', '1', args=['--js-library', 'check_webgl_attributes_support.js', '-DAA_ACTIVATED', '-DDEPTH_ACTIVATED', '-DSTENCIL_ACTIVATED', '-DALPHA_ACTIVATED', '-lGL', '-lglut', '-lGLEW']) | |||
self.btest('test_webgl_context_attributes_sdl.c', '1', args=['--js-library', 'check_webgl_attributes_support.js', '-DAA_ACTIVATED', '-DDEPTH_ACTIVATED', '-DSTENCIL_ACTIVATED', '-DALPHA_ACTIVATED', '-lGL', '-lSDL', '-lGLEW']) | |||
self.btest('test_webgl_context_attributes_sdl2.c', '1', args=['--js-library', 'check_webgl_attributes_support.js', '-DAA_ACTIVATED', '-DDEPTH_ACTIVATED', '-DSTENCIL_ACTIVATED', '-DALPHA_ACTIVATED', '-lGL', '-s', 'USE_SDL=2', '-lGLEW']) |
kripken
Oct 9, 2018
Member
is that a new file? maybe forgot to add it to the PR. but also, should it have egl
in the name?
is that a new file? maybe forgot to add it to the PR. but also, should it have egl
in the name?
Beuc
Oct 9, 2018
Author
Contributor
-_-'
That's a new file. I decided to run the test at the SDL2 level, which is what people more commonly use, and which itself relies on EGL.
-_-'
That's a new file. I decided to run the test at the SDL2 level, which is what people more commonly use, and which itself relies on EGL.
kripken
Oct 10, 2018
Member
Oh, I see, so this PR fixes SDL2 as well?
Oh, I see, so this PR fixes SDL2 as well?
Beuc
Oct 10, 2018
Author
Contributor
Yes, that's the goal :)
Yes, that's the goal :)
Thanks! Everything looks good, however |
I introduced a new variable without "var" and Closure complained. |
Great, thanks! |
1ec8881
into
emscripten-core:incoming
Cf. #7227