This is largely undocumented. From reading what documentation there is, I was 
under the impression that all that is needed is to set 
Module.preinitializedWebGLContext prior to creating the module. However it 
appears that you also need to do

Module.GL.makeContextCurrent(Module.GL.createContext(null, { majorVersion: 2.0 
}));

in the then() method when Module is created. Until I did that I was getting 
GLctx undefined errors.

So you could just as easily skip Module.preinitializedWebGLContext and pass the 
WebGL context to Module.GL.createContext instead of the null I have shown here.

Am I missing something,  i.e. doing something wrong, or is 
Module.preinitializedWebGLContext essentially useless?

By the way the Embind documentation really needs to say more about creating 
Modules. The noddy example didn’t help me at all in the case of creating a 
class binding.

Regards

    -Mark

> On Jan 7, 2020, at 17:23, キャロウ マーク <[email protected]> wrote:
> 
> I think the issue is that Module will not be found until initialization of 
> the runtime is finished. This raises the following question. Will
> 
>    Module.preinitializedWebGLContext = gl;
> 
> in onRuntimeInitialized (before making any Emscripten OpenGL ES calls) work 
> or do I need so somehow arrange for the JS app’s context creation to complete 
> together with setting of preinitializedWebGLContext before Emscripten runtime 
> initialization starts? If so, how do I accomplish that?
> 

-- 
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].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/emscripten-discuss/6EE5E398-366F-4099-B51C-D60200702AA9%40callow.im.

Attachment: signature.asc
Description: Message signed with OpenPGP

Reply via email to