summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/plugins/platforms/windows/qwindowsglcontext.cpp16
-rw-r--r--src/plugins/platforms/windows/qwindowsglcontext.h2
2 files changed, 9 insertions, 9 deletions
diff --git a/src/plugins/platforms/windows/qwindowsglcontext.cpp b/src/plugins/platforms/windows/qwindowsglcontext.cpp
index cc2f05b6d1..0a2d30319e 100644
--- a/src/plugins/platforms/windows/qwindowsglcontext.cpp
+++ b/src/plugins/platforms/windows/qwindowsglcontext.cpp
@@ -149,12 +149,12 @@ QT_BEGIN_NAMESPACE
QWindowsOpengl32DLL QOpenGLStaticContext::opengl32;
-void *QWindowsOpengl32DLL::resolve(const char *name)
+PROC QWindowsOpengl32DLL::resolve(const char *name)
{
#ifndef Q_OS_WINCE
- void *proc = m_lib ? (void *) ::GetProcAddress(m_lib, name) : 0;
+ PROC proc = m_lib ? ::GetProcAddress(m_lib, name) : 0;
#else
- void *proc = m_lib ? (void *) ::GetProcAddress(m_lib, (const wchar_t *) QString::fromLatin1(name).utf16()) : 0;
+ PROC proc = m_lib ? ::GetProcAddress(m_lib, (const wchar_t *) QString::fromLatin1(name).utf16()) : 0;
#endif
return proc;
@@ -1339,21 +1339,21 @@ QFunctionPointer QWindowsGLContext::getProcAddress(const char *procName)
// Even though we use QFunctionPointer, it does not mean the function can be called.
// It will need to be cast to the proper function type with the correct calling
// convention. QFunctionPointer is nothing more than a glorified void* here.
- QFunctionPointer procAddress = reinterpret_cast<QFunctionPointer>(QOpenGLStaticContext::opengl32.wglGetProcAddress(procName));
+ PROC procAddress = QOpenGLStaticContext::opengl32.wglGetProcAddress(procName);
// We support AllGLFunctionsQueryable, which means this function must be able to
// return a function pointer even for functions that are in GL.h and exported
// normally from opengl32.dll. wglGetProcAddress() is not guaranteed to work for such
// functions, however in QT_OPENGL_DYNAMIC builds QOpenGLFunctions will just blindly
// call into here for _any_ OpenGL function.
- if (!procAddress || procAddress == reinterpret_cast<void *>(0x1) || procAddress == reinterpret_cast<void *>(0x2)
- || procAddress == reinterpret_cast<void *>(0x3) || procAddress == reinterpret_cast<void *>(-1))
- procAddress = reinterpret_cast<QFunctionPointer>(QOpenGLStaticContext::opengl32.resolve(procName));
+ if (!procAddress || procAddress == reinterpret_cast<PROC>(0x1) || procAddress == reinterpret_cast<PROC>(0x2)
+ || procAddress == reinterpret_cast<PROC>(0x3) || procAddress == reinterpret_cast<PROC>(-1))
+ procAddress = QOpenGLStaticContext::opengl32.resolve(procName);
if (QWindowsContext::verbose > 1)
qCDebug(lcQpaGl) << __FUNCTION__ << procName << QOpenGLStaticContext::opengl32.wglGetCurrentContext() << "returns" << procAddress;
- return procAddress;
+ return reinterpret_cast<QFunctionPointer>(procAddress);
}
QT_END_NAMESPACE
diff --git a/src/plugins/platforms/windows/qwindowsglcontext.h b/src/plugins/platforms/windows/qwindowsglcontext.h
index e8c78860f2..2944ab7192 100644
--- a/src/plugins/platforms/windows/qwindowsglcontext.h
+++ b/src/plugins/platforms/windows/qwindowsglcontext.h
@@ -122,7 +122,7 @@ struct QWindowsOpengl32DLL
void (APIENTRY * glGetIntegerv)(GLenum pname, GLint* params);
const GLubyte * (APIENTRY * glGetString)(GLenum name);
- void *resolve(const char *name);
+ PROC resolve(const char *name);
private:
HMODULE m_lib;
bool m_nonOpengl32;