summaryrefslogtreecommitdiffstats
path: root/src/gui/opengl/qopenglversionfunctions.cpp
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@theqtcompany.com>2016-02-12 12:50:12 +0100
committerLaszlo Agocs <laszlo.agocs@theqtcompany.com>2016-03-02 12:16:15 +0000
commit69f29b90322338bb7cd884a0cecdb8dd5dd2573e (patch)
treee0f9d7dd3d71b802fa25ca487bc232081179e1d0 /src/gui/opengl/qopenglversionfunctions.cpp
parent6b0a577bf85845780e9a7b101260cdf72fa1d33c (diff)
Clean up resolving of OpenGL functions on Windows
Always try both e/wglGetProcAddress and ::GetProcAddress to resolve the methods. Like this QOpengGLContext::getProcAddress is able to return any OpenGL entry point, and we can both simplify the code we have in the QPA backend as well as get rid of windows specific code paths in Qt Gui. Task-number: QTBUG-39531 Change-Id: I1ddf1b0974f69b56b219a619655b723eb0134b14 Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
Diffstat (limited to 'src/gui/opengl/qopenglversionfunctions.cpp')
-rw-r--r--src/gui/opengl/qopenglversionfunctions.cpp26
1 files changed, 4 insertions, 22 deletions
diff --git a/src/gui/opengl/qopenglversionfunctions.cpp b/src/gui/opengl/qopenglversionfunctions.cpp
index 3fba00bc47..9fa224b0aa 100644
--- a/src/gui/opengl/qopenglversionfunctions.cpp
+++ b/src/gui/opengl/qopenglversionfunctions.cpp
@@ -67,24 +67,6 @@ void CLASS::init() \
} \
}
-#ifdef Q_OS_WIN
-#define QT_OPENGL_IMPLEMENT_WIN(CLASS, FUNCTIONS) \
-void CLASS::init() \
-{ \
- HMODULE handle = static_cast<HMODULE>(QOpenGLContext::openGLModuleHandle()); \
- if (!handle) \
- handle = GetModuleHandleA("opengl32.dll"); \
- const char *names = FUNCTIONS(QT_OPENGL_FUNCTION_NAMES); \
- const char *name = names; \
- for (int i = 0; i < FUNCTIONS(QT_OPENGL_COUNT_FUNCTIONS); ++i) { \
- functions[i] = (QFunctionPointer)GetProcAddress(handle, name); \
- name += strlen(name) + 1; \
- } \
-}
-#else
-#define QT_OPENGL_IMPLEMENT_WIN QT_OPENGL_IMPLEMENT
-#endif
-
QOpenGLVersionFunctionsStorage::QOpenGLVersionFunctionsStorage()
: backends(0)
{
@@ -325,8 +307,8 @@ QOpenGLContext *QAbstractOpenGLFunctions::owningContext() const
#if !defined(QT_OPENGL_ES_2)
-QT_OPENGL_IMPLEMENT_WIN(QOpenGLFunctions_1_0_CoreBackend, QT_OPENGL_1_0_FUNCTIONS)
-QT_OPENGL_IMPLEMENT_WIN(QOpenGLFunctions_1_1_CoreBackend, QT_OPENGL_1_1_FUNCTIONS)
+QT_OPENGL_IMPLEMENT(QOpenGLFunctions_1_0_CoreBackend, QT_OPENGL_1_0_FUNCTIONS)
+QT_OPENGL_IMPLEMENT(QOpenGLFunctions_1_1_CoreBackend, QT_OPENGL_1_1_FUNCTIONS)
QT_OPENGL_IMPLEMENT(QOpenGLFunctions_1_2_CoreBackend, QT_OPENGL_1_2_FUNCTIONS)
QT_OPENGL_IMPLEMENT(QOpenGLFunctions_1_3_CoreBackend, QT_OPENGL_1_3_FUNCTIONS)
@@ -345,8 +327,8 @@ QT_OPENGL_IMPLEMENT(QOpenGLFunctions_4_3_CoreBackend, QT_OPENGL_4_3_FUNCTIONS)
QT_OPENGL_IMPLEMENT(QOpenGLFunctions_4_4_CoreBackend, QT_OPENGL_4_4_FUNCTIONS)
QT_OPENGL_IMPLEMENT(QOpenGLFunctions_4_5_CoreBackend, QT_OPENGL_4_5_FUNCTIONS)
-QT_OPENGL_IMPLEMENT_WIN(QOpenGLFunctions_1_0_DeprecatedBackend, QT_OPENGL_1_0_DEPRECATED_FUNCTIONS)
-QT_OPENGL_IMPLEMENT_WIN(QOpenGLFunctions_1_1_DeprecatedBackend, QT_OPENGL_1_1_DEPRECATED_FUNCTIONS)
+QT_OPENGL_IMPLEMENT(QOpenGLFunctions_1_0_DeprecatedBackend, QT_OPENGL_1_0_DEPRECATED_FUNCTIONS)
+QT_OPENGL_IMPLEMENT(QOpenGLFunctions_1_1_DeprecatedBackend, QT_OPENGL_1_1_DEPRECATED_FUNCTIONS)
QT_OPENGL_IMPLEMENT(QOpenGLFunctions_1_2_DeprecatedBackend, QT_OPENGL_1_2_DEPRECATED_FUNCTIONS)
QT_OPENGL_IMPLEMENT(QOpenGLFunctions_1_3_DeprecatedBackend, QT_OPENGL_1_3_DEPRECATED_FUNCTIONS)