It seems the GL wrapper implementation has changed a lot quite recently. >From my (external) pov it seems to work like this now:
There's a C part here: https://github.com/emscripten-core/emscripten/tree/incoming/system/lib/gl ...which looks like it's just a library of slim C proxy functions which forward the GL calls to the Javascript side for different scenarios (e.g. GL code running on the main thread or not). The actually interesting stuff happens in JS code here: https://github.com/emscripten-core/emscripten/blob/incoming/src/library_webgl.js https://github.com/emscripten-core/emscripten/blob/incoming/src/library_webgl2.js https://github.com/emscripten-core/emscripten/blob/incoming/src/library_glemu.js This basically emulates GLES2, GLES3 or desktop GL on top of WebGL or WebGL2 (at the very least this must map GL object handles which are GLuint's in C code to Javascript objects, but there's a lot more stuff going on which I haven't looked at in detail). A while ago all this was in a single library_gl.js source file, but I think conceptually this did the same. I have no clue about the SDL vs GL problems you're seeing unfortunately, my code uses the emscripten_webgl_*() functions for context setup. Cheers! On Tuesday, 2 April 2019 22:59:39 UTC+2, Rick Battagline wrote: > > Hi, > > I've been having some problems mixing SDL and OpenGL. Changing the > shaders using calls to OpenGL seems to be creating problems with SDL. I'm > trying to figure out how the Emscripten port of OpenGL works. Looking > through some of the glue code it looks like there is some webgl code that I > assume is being called from the WebAssembly. > > Does anyone know how the Emscripten implementation of OpenGL works? > > Where can I find the code for the OpenGL Emscripten implementation? > > Thanks > -- You received this message because you are subscribed to the Google Groups "emscripten-discuss" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
