summaryrefslogtreecommitdiffstats
path: root/src/gui/opengl/qopenglfunctions.cpp
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.agocs@digia.com>2014-02-28 17:03:57 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-03-04 15:59:05 +0100
commit4b2f35d04ca3c2e037b4d0edd8b2350051cc572c (patch)
treeb6cf33e9cba3e55b11be748fa37fd44b09021b54 /src/gui/opengl/qopenglfunctions.cpp
parentfe2ce05d23a52d27e50270d22eb9fff9ab091dd4 (diff)
Dynamic GL: remove exporting symbols
Remove the opengl proxy for now. Later it will either be moved into a separate library or replaced by a QOpenGLFunctions-based approach. This means that the -opengl dynamic configuration is not usable for the time being. The rest of the enablers remain in place. The convenience function QOpenGLFunctions::isES() is now moved to QOpenGLContext and is changed to check the renderable type. This is extremely useful since besides supporting dynamic GL it solves also the problem of GL_ARB_ES2_compatibility (i.e. it triggers the real ES path when creating an ES-compatible context with a desktop OpenGL implementation). Task-number: QTBUG-36483 Task-number: QTBUG-37172 Change-Id: I045be3fc16e9043e1528cf48e6bf0903da4fa7ca Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
Diffstat (limited to 'src/gui/opengl/qopenglfunctions.cpp')
-rw-r--r--src/gui/opengl/qopenglfunctions.cpp94
1 files changed, 7 insertions, 87 deletions
diff --git a/src/gui/opengl/qopenglfunctions.cpp b/src/gui/opengl/qopenglfunctions.cpp
index 60743b3a277..9a52ae2a9f7 100644
--- a/src/gui/opengl/qopenglfunctions.cpp
+++ b/src/gui/opengl/qopenglfunctions.cpp
@@ -249,7 +249,9 @@ QOpenGLExtensions::QOpenGLExtensions(QOpenGLContext *context)
static int qt_gl_resolve_features()
{
- if (QOpenGLFunctions::platformGLType() == QOpenGLFunctions::GLES2) {
+ QOpenGLContext *ctx = QOpenGLContext::currentContext();
+ if (ctx->isES() && QOpenGLContext::openGLModuleType() != QOpenGLContext::GLES1) {
+ // OpenGL ES 2
int features = QOpenGLFunctions::Multitexture |
QOpenGLFunctions::Shaders |
QOpenGLFunctions::Buffers |
@@ -269,7 +271,8 @@ static int qt_gl_resolve_features()
features |= QOpenGLFunctions::NPOTTextures |
QOpenGLFunctions::NPOTTextureRepeat;
return features;
- } else if (QOpenGLFunctions::platformGLType() == QOpenGLFunctions::GLES1) {
+ } else if (ctx->isES()) {
+ // OpenGL ES 1
int features = QOpenGLFunctions::Multitexture |
QOpenGLFunctions::Buffers |
QOpenGLFunctions::CompressedTextures |
@@ -289,6 +292,7 @@ static int qt_gl_resolve_features()
features |= QOpenGLFunctions::NPOTTextures;
return features;
} else {
+ // OpenGL
int features = 0;
QSurfaceFormat format = QOpenGLContext::currentContext()->format();
QOpenGLExtensionMatcher extensions;
@@ -352,7 +356,7 @@ static int qt_gl_resolve_extensions()
if (extensionMatcher.match("GL_EXT_bgra"))
extensions |= QOpenGLExtensions::BGRATextureFormat;
- if (QOpenGLFunctions::isES()) {
+ if (QOpenGLContext::currentContext()->isES()) {
if (extensionMatcher.match("GL_OES_mapbuffer"))
extensions |= QOpenGLExtensions::MapBuffer;
if (extensionMatcher.match("GL_OES_packed_depth_stencil"))
@@ -2511,88 +2515,4 @@ QOpenGLExtensionsPrivate::QOpenGLExtensionsPrivate(QOpenGLContext *ctx)
GetBufferSubData = qopenglfResolveGetBufferSubData;
}
-#if defined(QT_OPENGL_DYNAMIC)
-extern int qgl_proxyLibraryType(void);
-extern HMODULE qgl_glHandle(void);
-#endif
-
-/*!
- \enum QOpenGLFunctions::PlatformGLType
- This enum defines the type of the underlying GL implementation.
-
- \value DesktopGL Desktop OpenGL
- \value GLES2 OpenGL ES 2.0 or higher
- \value GLES1 OpenGL ES 1.x
-
- \since 5.3
- */
-
-/*!
- \fn QOpenGLFunctions::isES()
-
- On platforms where the OpenGL implementation is dynamically loaded
- this function returns true if the underlying GL implementation is
- Open GL ES.
-
- On platforms that do not use runtime loading of the GL the return
- value is based on Qt's compile-time configuration and will never
- change during runtime.
-
- \sa platformGLType()
-
- \since 5.3
- */
-
-/*!
- Returns the underlying GL implementation type.
-
- On platforms where the OpenGL implementation is not dynamically
- loaded, the return value is determined during compile time and never
- changes.
-
- Platforms that use dynamic GL loading (e.g. Windows) cannot rely on
- compile-time defines for differentiating between desktop and ES
- OpenGL code. Instead, they rely on this function to query, during
- runtime, the type of the loaded graphics library.
-
- \since 5.3
- */
-QOpenGLFunctions::PlatformGLType QOpenGLFunctions::platformGLType()
-{
-#if defined(QT_OPENGL_DYNAMIC)
- return PlatformGLType(qgl_proxyLibraryType());
-#elif defined(QT_OPENGL_ES_2)
- return GLES2;
-#elif defined(QT_OPENGL_ES)
- return GLES1;
-#else
- return DesktopGL;
-#endif
-}
-
-/*!
- Returns the platform-specific handle for the OpenGL implementation that
- is currently in use. (for example, a HMODULE on Windows)
-
- On platforms that do not use dynamic GL switch the return value is null.
-
- The library might be GL-only, meaning that windowing system interface
- functions (for example EGL) may live in another, separate library.
-
- Always use platformGLType() before resolving any functions to check if the
- library implements desktop OpenGL or OpenGL ES.
-
- \sa platformGLType()
-
- \since 5.3
- */
-void *QOpenGLFunctions::platformGLHandle()
-{
-#if defined(QT_OPENGL_DYNAMIC)
- return qgl_glHandle();
-#else
- return 0;
-#endif
-}
-
QT_END_NAMESPACE