+//#define GL_BUG
+#ifdef GL_BUG
+static void GLAPIENTRY glDebugCallback(GLenum source, GLenum type,
+ GLuint id, GLenum severity, GLsizei length, const GLchar* message,
+ const void* userParam)
+{
+ if( type == GL_DEBUG_TYPE_OTHER &&
+ severity == GL_DEBUG_SEVERITY_NOTIFICATION ) return;
+ fprintf(stderr, "GL CALLBACK: %s type = 0x%x, severity = 0x%x, message = %s\n",
+ ( type == GL_DEBUG_TYPE_ERROR ? "** GL ERROR **" : "" ),
+ type, severity, message );
+}
+#endif
+