GLUT: support more glutGet() attributes #7243
Conversation
@@ -427,6 +427,14 @@ var LibraryGLUT = { | |||
case 700: /* GLUT_ELAPSED_TIME */ | |||
var now = Date.now(); | |||
return now - GLUT.initTime; | |||
case 0x0069: /* GLUT_WINDOW_STENCIL_SIZE */ | |||
return Module.ctx.getContextAttributes().stencil ? 8 : 0; |
kripken
Oct 9, 2018
Member
indentation looks wrong here
indentation looks wrong here
Beuc
Oct 9, 2018
Author
Contributor
Sorry, a tab got included instead of spaces. Fixed :)
Sorry, a tab got included instead of spaces. Fixed :)
Thanks, looks good, just need a test before merging. |
I added a test case. It's run twice because there's currently no support for destroying/recreating webgl contexts. I also needed a gratuitous glClear() call to prevent library_gl.js from being stripped (GL.xxx referenced in library_glut.glutCreateWindow). |
For the record I don't understand why the test fails at circleci. |
I think some or all of those errors are due to previous issues we had on incoming. Please merge in latest incoming to here, that may fix things. |
I rebased the patch on incoming. |
Looks like it fixed everything but the new test added here. I think the issue there is that the bot doesn't have graphics hardware, so you need to annotate the test with |
Hmm, still no luck. |
It's kind of an odd graphics context, see Getting printf is possible with emrun, for example, if you replace the
That will build the file for emrun, then run it in emrun, which will log out stderr to the console. (Note that you need to remove stuff like |
Might be worth comparing to the other tests that use antialiasing/stencil/etc. - they do pass, so finding what the difference is might help. |
(OMG what have I gotten myself into -_-' I don't even need that patch.. ;)) |
Cool, makes sense. Will merge after CI finishes. |
914cb76
into
emscripten-core:incoming
Yay! |
Adding support for more glutGet() queries for webgl attributes i.e. antialias/alpha/depth/stencil.