foo
[nexus3d] / src / gl / opengl.c
index 06fedef..97ac185 100644 (file)
@@ -1,6 +1,7 @@
 #include <stdio.h>
 #include <unistd.h>
 #include "opengl.h"
+#include "nexus3d_impl.h"
 
 static void GLAPIENTRY gldebug_logger(GLenum src, GLenum type, GLuint id, GLenum severity,
                GLsizei len, const char *msg, const void *cls);
@@ -14,7 +15,10 @@ int init_gl(void)
 {
        glewInit();
 
-       glDebugMessageCallbackARB(gldebug_logger, 0);
+       if(nex_apicfg.gl.flags & NEX_OPENGL_DEBUG) {
+               glDebugMessageCallbackARB(gldebug_logger, 0);
+               glEnable(GL_DEBUG_OUTPUT);
+       }
        return 0;
 }