[Bf-blender-cvs] [6c9fe9cd8ca] blender2.8: Revert "GHOST: WGL: Delay context initialization for offscreen contexts."
Clément Foucault
noreply at git.blender.org
Tue Jul 3 13:36:12 CEST 2018
Commit: 6c9fe9cd8ca0ac0bfbe00463d73d3c79b1bff6f3
Author: Clément Foucault
Date: Mon Jul 2 19:39:02 2018 +0200
Branches: blender2.8
https://developer.blender.org/rB6c9fe9cd8ca0ac0bfbe00463d73d3c79b1bff6f3
Revert "GHOST: WGL: Delay context initialization for offscreen contexts."
This reverts commit 800c3c5ca581d5427c4270c60f022c3ccdd8b312.
# Conflicts:
# intern/ghost/intern/GHOST_ContextWGL.cpp
===================================================================
M intern/ghost/intern/GHOST_ContextWGL.cpp
M intern/ghost/intern/GHOST_ContextWGL.h
===================================================================
diff --git a/intern/ghost/intern/GHOST_ContextWGL.cpp b/intern/ghost/intern/GHOST_ContextWGL.cpp
index 883c06ecf78..035b0c268c6 100644
--- a/intern/ghost/intern/GHOST_ContextWGL.cpp
+++ b/intern/ghost/intern/GHOST_ContextWGL.cpp
@@ -139,10 +139,6 @@ GHOST_TSuccess GHOST_ContextWGL::getSwapInterval(int &intervalOut)
GHOST_TSuccess GHOST_ContextWGL::activateDrawingContext()
{
- if (m_init == false) {
- initContext();
- }
-
if (WIN32_CHK(::wglMakeCurrent(m_hDC, m_hGLRC))) {
return GHOST_kSuccess;
}
@@ -892,23 +888,8 @@ GHOST_TSuccess GHOST_ContextWGL::initializeDrawingContext()
goto error;
}
- initContext();
-
- initClearGL();
- ::SwapBuffers(m_hDC);
-
- return GHOST_kSuccess;
-error:
- ::wglMakeCurrent(prevHDC, prevHGLRC);
- return GHOST_kFailure;
-
-}
-
-
-GHOST_TSuccess GHOST_ContextWGL::initContext()
-{
if (!WIN32_CHK(::wglMakeCurrent(m_hDC, m_hGLRC))) {
- return GHOST_kFailure;
+ goto error;
}
initContextGLEW();
@@ -922,7 +903,8 @@ GHOST_TSuccess GHOST_ContextWGL::initContext()
glEnable(GL_POINT_SPRITE);
}
- m_init = true;
+ initClearGL();
+ ::SwapBuffers(m_hDC);
#ifndef NDEBUG
const char *vendor = reinterpret_cast<const char*>(glGetString(GL_VENDOR));
@@ -937,6 +919,10 @@ GHOST_TSuccess GHOST_ContextWGL::initContext()
#endif
return GHOST_kSuccess;
+error:
+ ::wglMakeCurrent(prevHDC, prevHGLRC);
+ return GHOST_kFailure;
+
}
diff --git a/intern/ghost/intern/GHOST_ContextWGL.h b/intern/ghost/intern/GHOST_ContextWGL.h
index 7711f90a9e9..2ffe9523008 100644
--- a/intern/ghost/intern/GHOST_ContextWGL.h
+++ b/intern/ghost/intern/GHOST_ContextWGL.h
@@ -140,13 +140,11 @@ private:
bool needStencil,
bool sRGB,
int swapMethod);
- GHOST_TSuccess initContext();
void initContextWGLEW(PIXELFORMATDESCRIPTOR &preferredPFD);
HWND m_hWnd;
HDC m_hDC;
- bool m_init;
const int m_contextProfileMask;
const int m_contextMajorVersion;
More information about the Bf-blender-cvs
mailing list