Browse Source

opengl error reporting formatting

Azaezel 10 years ago
parent
commit
fdbe6ce849
1 changed files with 15 additions and 10 deletions
  1. 15 10
      Engine/source/gfx/gl/gfxGLDevice.cpp

+ 15 - 10
Engine/source/gfx/gl/gfxGLDevice.cpp

@@ -82,20 +82,25 @@ void loadGLExtensions(void *context)
 }
 
 void STDCALL glDebugCallback(GLenum source, GLenum type, GLuint id,
-   GLenum severity, GLsizei length, const GLchar* message, void* userParam)
+    GLenum severity, GLsizei length, const GLchar* message, void* userParam)
 {
-#if defined(TORQUE_DEBUG) && !defined(TORQUE_DEBUG_GFX)
-	if( type == GL_DEBUG_TYPE_OTHER_ARB ) 
-		return;
-#endif
-
-   Con::errorf("OPENGL: %s", message);
+    if (severity == GL_DEBUG_SEVERITY_HIGH)
+        Con::errorf("OPENGL: %s", message);
+    else if (severity == GL_DEBUG_SEVERITY_MEDIUM)
+        Con::warnf("OPENGL: %s", message);
+    else if (severity == GL_DEBUG_SEVERITY_LOW)
+        Con::printf("OPENGL: %s", message);
 }
 
 void STDCALL glAmdDebugCallback(GLuint id, GLenum category, GLenum severity, GLsizei length,
-   const GLchar* message,GLvoid* userParam)
-{
-   Con::errorf("OPENGL: %s",message);
+    const GLchar* message, GLvoid* userParam)
+{
+    if (severity == GL_DEBUG_SEVERITY_HIGH)
+        Con::errorf("AMDOPENGL: %s", message);
+    else if (severity == GL_DEBUG_SEVERITY_MEDIUM)
+        Con::warnf("AMDOPENGL: %s", message);
+    else if (severity == GL_DEBUG_SEVERITY_LOW)
+        Con::printf("AMDOPENGL: %s", message);
 }
 
 void GFXGLDevice::initGLState()