summaryrefslogtreecommitdiffstats
path: root/src/gui/opengl/qopenglfunctions.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/opengl/qopenglfunctions.cpp')
-rw-r--r--src/gui/opengl/qopenglfunctions.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/gui/opengl/qopenglfunctions.cpp b/src/gui/opengl/qopenglfunctions.cpp
index 44b56699df..3631c019d3 100644
--- a/src/gui/opengl/qopenglfunctions.cpp
+++ b/src/gui/opengl/qopenglfunctions.cpp
@@ -173,6 +173,7 @@ QT_BEGIN_NAMESPACE
\value NPOTTextures Non power of two textures are available.
\value NPOTTextureRepeat Non power of two textures can use GL_REPEAT as wrap parameter.
\value FixedFunctionPipeline The fixed function pipeline is available.
+ \value TextureRGFormats The GL_RED and GL_RG texture formats are available.
*/
// Hidden private fields for additional extension data.
@@ -185,13 +186,13 @@ struct QOpenGLFunctionsPrivateEx : public QOpenGLExtensionsPrivate, public QOpen
, m_extensions(-1)
{}
- void invalidateResource()
+ void invalidateResource() Q_DECL_OVERRIDE
{
m_features = -1;
m_extensions = -1;
}
- void freeResource(QOpenGLContext *)
+ void freeResource(QOpenGLContext *) Q_DECL_OVERRIDE
{
// no gl resources to free
}
@@ -284,10 +285,12 @@ static int qt_gl_resolve_features()
if (extensions.match("GL_OES_texture_npot"))
features |= QOpenGLFunctions::NPOTTextures |
QOpenGLFunctions::NPOTTextureRepeat;
+ if (ctx->format().majorVersion() >= 3 || extensions.match("GL_EXT_texture_rg"))
+ features |= QOpenGLFunctions::TextureRGFormats;
return features;
} else {
// OpenGL
- int features = 0;
+ int features = QOpenGLFunctions::TextureRGFormats;
QSurfaceFormat format = QOpenGLContext::currentContext()->format();
QOpenGLExtensionMatcher extensions;