>From glancing over the EGL wrapper code 
here: https://github.com/kripken/emscripten/blob/master/src/library_egl.js#L270

...it looks to me like there's no support for setting up a WebGL2 context.

You could use the emscripten_webgl_*() functions instead of EGL, these map 
directly to the HTML5 APIs, for instance here's my code to setup a WebGL2 
context, and if this fails fall back to WebGL1:

https://github.com/floooh/oryol/blob/master/code/Modules/Gfx/private/emsc/emscDisplayMgr.cc#L101

(you still need to link with "-s USE_WEBGL2=1")

Cheers,
-Floh.

Am Montag, 26. Juni 2017 23:09:04 UTC+2 schrieb Brian Gavin:
>
> Hi everyone,
> I want to create a webl2 canvas.   I create my canvas doing something 
> similar to emscripten/tests/test_egl.c   I pass the linker flag -s 
> USE_WEBGL2=1 
>
> I create a context setting the attributes like this to create a webgl 
> version 1
>
> EGLint contextAttribs[] =
>
> {
>
> EGL_CONTEXT_CLIENT_VERSION, 2,
>
> EGL_NONE
>
> };
>
>  I would assume that I would change to this EGL_CONTEXT_CLIENT_VERSION, 3 
> ?
>
> I would like to create a webgl 1 canvas since some platforms do not 
> support WebGL.
>
>
> What is the correct way to do this?
>
> Thanks,
> Brian Gavin
>

-- 
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.

Reply via email to