have you tried something like this?

#ifdef EMSCRIPTEN
  char req[] = "var ctx = Module.canvas.getContext('experimental-webgl');\n"
"if(ctx.getExtension('WEBKIT_WEBGL_depth_texture') != NULL) return 1;\n"
  "else if (ctx.getExtension('MOZ_WEBGL_depth_texture') != NULL) return 
1;\n"
  "else return 0;\n";

int res = emscripten_run_script(req);
#endif

WebGL extensions must be activated with getExtension() before being used...

On Wednesday, January 15, 2014 7:13:39 AM UTC+1, Bram Stolk wrote:
>
> My emscripted OpenGL-ES2 game fails to create a depth texture.
> The extension is supported on my machine, yet:
>
> I try to create the depth texture with:
> glTexImage2D( GL_TEXTURE_2D, 0, GL_DEPTH_COMPONENT, SHADOWBUFFERSIZE, 
> SHADOWBUFFERSIZE, 0, GL_DEPTH_COMPONENT, GL_UNSIGNED_INT, depthbuffermem );
>
> This results in:
> GL_INVALID_OPERATION
>
> I guess it could be a limit of WebGL not supporting depth textures?
> Or could it be something emscripten does not tolerate?
>
> I use firefox to load the HTML created with ASM_JS=1.
> Also, my frag+vert GLSL shaders get compiled and linked just fine.
>
> My OpenGL context is created via SDL:
> SDL_Surface* screen = SDL_SetVideoMode( 640, 480, 16, SDL_OPENGL );
>
> Thx,
>
>  bram
>
>

-- 
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/groups/opt_out.

Reply via email to