enable opengl debugging on x11

This commit is contained in:
Eduardo Bart
2012-04-12 16:24:00 -03:00
parent a46a16738c
commit 879827bdbc
3 changed files with 37 additions and 13 deletions

View File

@@ -28,17 +28,28 @@
Graphics g_graphics;
void oglDebugCallback(unsigned int source, unsigned int type, unsigned int id, unsigned int severity, int length, const char* message, void* userParam)
{
logWarning("OGL: ", message);
}
void Graphics::init()
{
logInfo("GPU ", glGetString(GL_RENDERER));
logInfo("OpenGL ", glGetString(GL_VERSION));
#ifndef OPENGL_ES2
// init GL extensions
GLenum err = glewInit();
if(err != GLEW_OK)
logFatal("Unable to init GLEW: ", glewGetErrorString(err));
#ifndef NDEBUG
if(GLEW_ARB_debug_output)
glDebugMessageCallbackARB(oglDebugCallback, NULL);
#endif
const char *requiredExtensions[] = {
"GL_ARB_vertex_program",
"GL_ARB_vertex_shader",