Revert "GHOST: WGL: Delay context initialization for offscreen contexts."

This reverts commit 800c3c5ca5.

# Conflicts:
#	intern/ghost/intern/GHOST_ContextWGL.cpp
This commit is contained in:
Clément Foucault 2018-07-02 19:39:02 +02:00
parent d78bcf9055
commit 6c9fe9cd8c
2 changed files with 7 additions and 23 deletions

View File

@ -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;
}

View File

@ -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;