Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/intern
diff options
context:
space:
mode:
authorClément Foucault <foucault.clem@gmail.com>2018-07-02 20:39:02 +0300
committerClément Foucault <foucault.clem@gmail.com>2018-07-03 14:36:04 +0300
commit6c9fe9cd8ca0ac0bfbe00463d73d3c79b1bff6f3 (patch)
tree54461a49f4265cbdfb5750daf05ec63a9c057a90 /intern
parentd78bcf90557a157555b0fafcf3f8d03e5b6496ca (diff)
Revert "GHOST: WGL: Delay context initialization for offscreen contexts."
This reverts commit 800c3c5ca581d5427c4270c60f022c3ccdd8b312. # Conflicts: # intern/ghost/intern/GHOST_ContextWGL.cpp
Diffstat (limited to 'intern')
-rw-r--r--intern/ghost/intern/GHOST_ContextWGL.cpp28
-rw-r--r--intern/ghost/intern/GHOST_ContextWGL.h2
2 files changed, 7 insertions, 23 deletions
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;