Trapping OpenGL Crash

BlitzMax Forums/BlitzMax Programming/Trapping OpenGL Crash

Like I said you have to check with OpenGL directly as to what errors it might be coming up with.

1) Make a Max2D call to some graphics routine
2) Ask OpenGL if there were errors and then decipher it

e.g.

Graphics(640,480,0)
Local Err:Int=glGetError(Varptr(Err))

something like that

After every Max2D call, which makes internal calls to OpenGL, you can check directly with OpenGL as to what the error codes were if any.

You should also clear out any errors at the start of your app so you start with a clean slate - ie

Repeat
Err=glGetError(Varptr(Err))
Until Err=GL_NO_ERROR

(or might be GL_NONE)

It doesn't matter if Max2d doesn't return error codes, that doesn't mean they aren't being generated or that you can't access them.