From 5adbb9cc576546c42249099e549f1947cca54610 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Mon, 4 Aug 2014 11:47:11 +0200 Subject: Support Alpha8 and Grayscale8 natively in the OpenGL paint engine Adds special shaders for the Alpha8 and Grayscale8 formats so that they do not need to rely on the support of GL_ALPHA and GL_LUMINANCE that has been removed from core in recent OpenGL versions. Change-Id: Ie370379b458abf2a50e252bc5099aefc1b11fb1d Reviewed-by: Laszlo Agocs --- src/gui/opengl/qopenglfunctions.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/gui/opengl/qopenglfunctions.cpp') diff --git a/src/gui/opengl/qopenglfunctions.cpp b/src/gui/opengl/qopenglfunctions.cpp index 44b56699df..67b978a570 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. @@ -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; -- cgit v1.2.3