Add BuildGLErrorCheck(), useful for debugging GL.

git-svn-id: https://svn.eduke32.com/eduke32@5641 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
hendricks266 2016-02-29 06:34:16 +00:00
parent e2df2d60d1
commit aec2da83cd
2 changed files with 15 additions and 0 deletions

View file

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

View file

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