When i compile my code, i get no errors or warnings, when i open the html 
created i get:

exception thrown: TypeError: Cannot read property 'createProgram' of 
undefined,TypeError: Cannot read property 'createProgram' of undefined at 
_glCreateProgram 

i looked into it and found that GLctx, which is the var that holds the 
context to create the program, is undefined because of a parameter passed 
into the function, useWebGL, which is false. the variable passed into the 
function is is_SDL_OPENGL, which is set 

var is_SDL_OPENGL = flags & 0x04000000; 
and the flags, im guessing, is the same as the flags set in the c++ code 
when calling setVideoMode. but the flag for sdl_opengl is evaluated to 2. 
the only place i found the flags to be set with that hex value is:

if (SDL.GL) flags = flags | 0x04000000; // SDL_OPENGL - if we are using GL, 
then later calls to SetVideoMode may not mention GL, but we do need it. 
Once in GL mode, we never leave it.

which is set shortly after the variable sdl is created, and SDL.Gl is 
initialized to false, shortly after posting i found SDL.GL is set a few 
lines before the variable ctx is created:

SDL.GL = SDL.GL || is_SDL_OPENGL;

but SDL.GL is false, and is_SDL_OPENGL is only true when SDL.GL is true, so 
SDL.GL is never set to true.


i tired the test cases and they worked fine. i am compiling on windows, 
using emcc main.cpp ... -o a.html, if that changes anything. and i am 
working on getting a testcase

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