From 0bb2b6213518fdc56181b0ab1d6a6635c324dfc2 Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Wed, 3 Sep 2014 16:38:25 +0200 Subject: [PATCH] windows: Fix dynamic opengl build Cannot call WGL or EGL functions directly anymore. Change-Id: I0d5c6217679d87a2092c945a9b841dfd7b6c299a Reviewed-by: Andrew Knight --- src/plugins/platforms/windows/qwindowseglcontext.cpp | 8 ++++---- src/plugins/platforms/windows/qwindowsglcontext.cpp | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/plugins/platforms/windows/qwindowseglcontext.cpp b/src/plugins/platforms/windows/qwindowseglcontext.cpp index 886757d4ff..e27b55da3e 100644 --- a/src/plugins/platforms/windows/qwindowseglcontext.cpp +++ b/src/plugins/platforms/windows/qwindowseglcontext.cpp @@ -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); diff --git a/src/plugins/platforms/windows/qwindowsglcontext.cpp b/src/plugins/platforms/windows/qwindowsglcontext.cpp index 1ed27f545d..869df26ef6 100644 --- a/src/plugins/platforms/windows/qwindowsglcontext.cpp +++ b/src/plugins/platforms/windows/qwindowsglcontext.cpp @@ -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.");