I am trying create webGL canvas and context in Javascript:

var canvas = document.getElementById('canvas');
var gl = canvas.getContext('webgl');
var buffer = gl.createBuffer();

and then use it in my cpp:

// EMSCRIPTEN_WEBGL_CONTEXT_HANDLE context = 
emscripten_webgl_create_context("#canvas", &attrs);...
glGenBuffers(1, &vb);

but without emscripten_webgl_create_context  I always get 

Uncaught (in promise) TypeError: Cannot read property 'createBuffer' of 
undefined
    at __glGenObject (output.js:1)

if I use emscripten_webgl_create_context all works well.

what am I doing wrong? Help much appreciated!

-- 
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/b51bce37-a3f4-4472-8e78-eb6de7e59b9a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to