ソースを参照

Ensure we get a debug context as appropriate in glx. (#1034)

If BGFX_CONFIG_DEBUG is defined, get a GL debug context. This mirrors the
behavior from wgl, and allows KHR_debug/ARB_debug_output messages to work.
Andrew Johnson 9 年 前
コミット
5cf641c3db
1 ファイル変更2 行追加0 行削除
  1. 2 0
      src/glcontext_glx.cpp

+ 2 - 0
src/glcontext_glx.cpp

@@ -155,10 +155,12 @@ namespace bgfx { namespace gl
 			if (NULL != glXCreateContextAttribsARB)
 			{
 				BX_TRACE("Create GL 3.1 context.");
+				int32_t flags = BGFX_CONFIG_DEBUG ? GLX_CONTEXT_DEBUG_BIT_ARB : 0;
 				const int contextAttrs[] =
 				{
 					GLX_CONTEXT_MAJOR_VERSION_ARB, 3,
 					GLX_CONTEXT_MINOR_VERSION_ARB, 1,
+					GLX_CONTEXT_FLAGS_ARB, flags,
 					GLX_CONTEXT_PROFILE_MASK_ARB, GLX_CONTEXT_CORE_PROFILE_BIT_ARB,
 					0,
 				};