diff --git a/polymer/eduke32/build/include/glbuild.h b/polymer/eduke32/build/include/glbuild.h index 4cd5f180d..7312bb98d 100644 --- a/polymer/eduke32/build/include/glbuild.h +++ b/polymer/eduke32/build/include/glbuild.h @@ -90,6 +90,12 @@ typedef unsigned int GLenum; #define GL_TEXTURE_RECTANGLE 0x84F5 +// custom error checking + +extern GLenum BuildGLError; +extern void BuildGLErrorCheck(void); + + //////// dynamic/static API wrapping //////// #if defined DYNAMIC_GL diff --git a/polymer/eduke32/build/src/glbuild.c b/polymer/eduke32/build/src/glbuild.c index 3b9a8fbf7..78be2d6ab 100644 --- a/polymer/eduke32/build/src/glbuild.c +++ b/polymer/eduke32/build/src/glbuild.c @@ -11,6 +11,15 @@ # include "sdlayer.h" #endif +GLenum BuildGLError; +void BuildGLErrorCheck(void) +{ + volatile GLenum err; + while ((err = bglGetError()) != GL_NO_ERROR) + { + BuildGLError = err; // set a watchpoint/breakpoint here + } +} #if defined DYNAMIC_GL