瀏覽代碼

Disable OpenGL warnings unless running with -v, closes #7171

Juan Linietsky 7 年之前
父節點
當前提交
2e3a1caa06
共有 2 個文件被更改,包括 6 次插入4 次删除
  1. 5 3
      drivers/gles3/rasterizer_gles3.cpp
  2. 1 1
      platform/windows/context_gl_win.cpp

+ 5 - 3
drivers/gles3/rasterizer_gles3.cpp

@@ -168,9 +168,11 @@ void RasterizerGLES3::initialize() {
 #ifdef __APPLE__
 // FIXME glDebugMessageCallbackARB does not seem to work on Mac OS X and opengl 3, this may be an issue with our opengl canvas..
 #else
-	glEnable(_EXT_DEBUG_OUTPUT_SYNCHRONOUS_ARB);
-	glDebugMessageCallbackARB(_gl_debug_print, NULL);
-	glEnable(_EXT_DEBUG_OUTPUT);
+	if (OS::get_singleton()->is_stdout_verbose()) {
+		glEnable(_EXT_DEBUG_OUTPUT_SYNCHRONOUS_ARB);
+		glDebugMessageCallbackARB(_gl_debug_print, NULL);
+		glEnable(_EXT_DEBUG_OUTPUT);
+	}
 #endif
 
 #endif

+ 1 - 1
platform/windows/context_gl_win.cpp

@@ -165,7 +165,7 @@ Error ContextGL_Win::initialize() {
 			WGL_CONTEXT_MAJOR_VERSION_ARB, 3, //we want a 3.3 context
 			WGL_CONTEXT_MINOR_VERSION_ARB, 3,
 			//and it shall be forward compatible so that we can only use up to date functionality
-			WGL_CONTEXT_FLAGS_ARB, WGL_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB | _WGL_CONTEXT_DEBUG_BIT_ARB,
+			WGL_CONTEXT_FLAGS_ARB, WGL_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB /*| _WGL_CONTEXT_DEBUG_BIT_ARB*/,
 			0
 		}; //zero indicates the end of the array