summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/vcl/opengl/OpenGLContext.hxx1
-rw-r--r--vcl/source/opengl/OpenGLContext.cxx29
2 files changed, 23 insertions, 7 deletions
diff --git a/include/vcl/opengl/OpenGLContext.hxx b/include/vcl/opengl/OpenGLContext.hxx
index 94ba1edf0d6d..2f147623fe59 100644
--- a/include/vcl/opengl/OpenGLContext.hxx
+++ b/include/vcl/opengl/OpenGLContext.hxx
@@ -234,6 +234,7 @@ public:
private:
SAL_DLLPRIVATE bool InitGLEW();
+ SAL_DLLPRIVATE void InitGLEWDebugging();
SAL_DLLPRIVATE bool initWindow();
SAL_DLLPRIVATE bool ImplInit();
#if defined( UNX ) && !defined MACOSX && !defined IOS && !defined ANDROID && !defined(LIBO_HEADLESS)
diff --git a/vcl/source/opengl/OpenGLContext.cxx b/vcl/source/opengl/OpenGLContext.cxx
index c106067dbc2b..051b151e8cef 100644
--- a/vcl/source/opengl/OpenGLContext.cxx
+++ b/vcl/source/opengl/OpenGLContext.cxx
@@ -771,7 +771,9 @@ bool OpenGLContext::ImplInit()
}
}
- return InitGLEW();
+ bool bRet = InitGLEW();
+ InitGLEWDebugging();
+ return bRet;
}
#elif defined( _WIN32 )
@@ -875,7 +877,14 @@ bool OpenGLContext::ImplInit()
// now setup the shared context; this needs a temporary context already
// set up in order to work
- m_aGLWin.hRC = wglCreateContextAttribsARB(m_aGLWin.hDC, hSharedCtx, NULL);
+ int attribs [] =
+ {
+#ifdef DBG_UTIL
+ WGL_CONTEXT_FLAGS_ARB, WGL_CONTEXT_DEBUG_BIT_ARB,
+#endif
+ 0
+ };
+ m_aGLWin.hRC = wglCreateContextAttribsARB(m_aGLWin.hDC, hSharedCtx, attribs);
if (m_aGLWin.hRC == 0)
{
ImplWriteLastError(GetLastError(), "wglCreateContextAttribsARB in OpenGLContext::ImplInit");
@@ -884,6 +893,7 @@ bool OpenGLContext::ImplInit()
}
wglMakeCurrent(NULL, NULL);
+ InitGLEWDebugging();
wglDeleteContext(hTempRC);
if (!wglMakeCurrent(m_aGLWin.hDC, m_aGLWin.hRC))
@@ -911,7 +921,9 @@ bool OpenGLContext::ImplInit()
NSOpenGLView* pView = getOpenGLView();
OpenGLWrapper::makeCurrent(pView);
- return InitGLEW();
+ bool bRet = InitGLEW();
+ InitGLEWDebugging();
+ return bRet;
}
#else
@@ -940,6 +952,13 @@ bool OpenGLContext::InitGLEW()
bGlewInit = true;
}
+ SAL_INFO("vcl.opengl", "OpenGLContext::ImplInit----end");
+ mbInitialized = true;
+ return true;
+}
+
+void OpenGLContext::InitGLEWDebugging()
+{
#ifdef DBG_UTIL
// only enable debug output in dbgutil build
if( GLEW_ARB_debug_output)
@@ -957,10 +976,6 @@ bool OpenGLContext::InitGLEW()
}
#endif
-
- SAL_INFO("vcl.opengl", "OpenGLContext::ImplInit----end");
- mbInitialized = true;
- return true;
}
void OpenGLContext::setWinPosAndSize(const Point &rPos, const Size& rSize)