summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKim Motoyoshi Kalland <kim.kalland@nokia.com>2011-05-11 10:53:00 +0200
committerKim Motoyoshi Kalland <kim.kalland@nokia.com>2011-05-11 11:59:50 +0200
commit7fce0a73cc9b099c4ca67b3bc2e8bbe3060230c6 (patch)
treee55e0c91cbead4da0fe59cce74f00555ba5118db /src
parentfda40e37df1152b5a8c572fe4bc53620bfcbcc45 (diff)
Check if OES_texture_npot is present on OpenGL ES 2.
Unless the OES_texture_npot extension is present, non-power- of-two textures have some restrictions on OpenGL ES 2. Reviewed-by: Samuel
Diffstat (limited to 'src')
-rw-r--r--src/opengl/qglfunctions.cpp32
1 files changed, 19 insertions, 13 deletions
diff --git a/src/opengl/qglfunctions.cpp b/src/opengl/qglfunctions.cpp
index 8027081543..e478fa7a4c 100644
--- a/src/opengl/qglfunctions.cpp
+++ b/src/opengl/qglfunctions.cpp
@@ -211,19 +211,23 @@ QGLFunctions::QGLFunctions(const QGLContext *context)
static int qt_gl_resolve_features()
{
#if defined(QT_OPENGL_ES_2)
- return QGLFunctions::Multitexture |
- QGLFunctions::Shaders |
- QGLFunctions::Buffers |
- QGLFunctions::Framebuffers |
- QGLFunctions::BlendColor |
- QGLFunctions::BlendEquation |
- QGLFunctions::BlendEquationSeparate |
- QGLFunctions::BlendFuncSeparate |
- QGLFunctions::BlendSubtract |
- QGLFunctions::CompressedTextures |
- QGLFunctions::Multisample |
- QGLFunctions::StencilSeparate |
- QGLFunctions::NPOTTextures;
+ int features = QGLFunctions::Multitexture |
+ QGLFunctions::Shaders |
+ QGLFunctions::Buffers |
+ QGLFunctions::Framebuffers |
+ QGLFunctions::BlendColor |
+ QGLFunctions::BlendEquation |
+ QGLFunctions::BlendEquationSeparate |
+ QGLFunctions::BlendFuncSeparate |
+ QGLFunctions::BlendSubtract |
+ QGLFunctions::CompressedTextures |
+ QGLFunctions::Multisample |
+ QGLFunctions::StencilSeparate;
+ if (extensions.match("GL_OES_texture_npot"))
+ features |= QGLFunctions::NPOTTextures;
+ if (extensions.match("GL_IMG_texture_npot"))
+ features |= QGLFunctions::NPOTTextures;
+ return features;
#elif defined(QT_OPENGL_ES)
int features = QGLFunctions::Multitexture |
QGLFunctions::Buffers |
@@ -240,6 +244,8 @@ static int qt_gl_resolve_features()
features |= QGLFunctions::BlendSubtract;
if (extensions.match("GL_OES_texture_npot"))
features |= QGLFunctions::NPOTTextures;
+ if (extensions.match("GL_IMG_texture_npot"))
+ features |= QGLFunctions::NPOTTextures;
return features;
#else
int features = 0;