windows: Fix dynamic opengl build

Cannot call WGL or EGL functions directly anymore.

Change-Id: I0d5c6217679d87a2092c945a9b841dfd7b6c299a
Reviewed-by: Andrew Knight <andrew.knight@digia.com>
bb10
Laszlo Agocs 2014-09-03 16:38:25 +02:00
parent 38ea5428c4
commit 0bb2b62135
2 changed files with 6 additions and 6 deletions

View File

@ -541,12 +541,12 @@ QWindowsEGLContext::QWindowsEGLContext(QWindowsEGLStaticContext *staticContext,
if (pbuffer == EGL_NO_SURFACE)
return;
EGLDisplay prevDisplay = eglGetCurrentDisplay();
EGLDisplay prevDisplay = QWindowsEGLStaticContext::libEGL.eglGetCurrentDisplay();
if (prevDisplay == EGL_NO_DISPLAY) // when no context is current
prevDisplay = m_eglDisplay;
EGLContext prevContext = eglGetCurrentContext();
EGLSurface prevSurfaceDraw = eglGetCurrentSurface(EGL_DRAW);
EGLSurface prevSurfaceRead = eglGetCurrentSurface(EGL_READ);
EGLContext prevContext = QWindowsEGLStaticContext::libEGL.eglGetCurrentContext();
EGLSurface prevSurfaceDraw = QWindowsEGLStaticContext::libEGL.eglGetCurrentSurface(EGL_DRAW);
EGLSurface prevSurfaceRead = QWindowsEGLStaticContext::libEGL.eglGetCurrentSurface(EGL_READ);
if (QWindowsEGLStaticContext::libEGL.eglMakeCurrent(m_eglDisplay, pbuffer, pbuffer, m_eglContext)) {
const GLubyte *s = QWindowsEGLStaticContext::libGLESv2.glGetString(GL_VERSION);

View File

@ -1207,8 +1207,8 @@ QWindowsGLContext::~QWindowsGLContext()
bool QWindowsGLContext::updateObtainedParams(HDC hdc, int *obtainedSwapInterval)
{
HGLRC prevContext = wglGetCurrentContext();
HDC prevSurface = wglGetCurrentDC();
HGLRC prevContext = QOpenGLStaticContext::opengl32.wglGetCurrentContext();
HDC prevSurface = QOpenGLStaticContext::opengl32.wglGetCurrentDC();
if (!QOpenGLStaticContext::opengl32.wglMakeCurrent(hdc, m_renderingContext)) {
qWarning("Failed to make context current.");