Catch WebGL errors in Lime/OpenFL

Hi guys,

Does anyone know if there’s a reliable way to catch WebGL errors in Lime/OpenFL?
I can see the error codes in Lime API docs, I’m just not sure how to handle GL errors from within code (and possibly without external javascript)

I’m specifically looking for handling gl.OUT_OF_MEMORY and gl.CONTEXT_LOST_WEBGL in a reliable way.

Thank you

1 Like

if you’re using Lime you can catch context lost event by listening onRenderContextLost signal in application’s window
or in case of OpenFL with Lime:
openfl.Lib.application.window.onRenderContextLost.add(onContextLost);
where onContextLost is the function without arguments

The case of OUT_OF_MEMORY error isn’t catchable (but i might be wrong about it)

1 Like

Thank you.
I ended up using a JavaScript and Haxe externs to check if there’s a WebGL error.