diff options
author | Kim Motoyoshi Kalland <kim.kalland@nokia.com> | 2011-05-11 08:53:00 (GMT) |
---|---|---|
committer | Kim Motoyoshi Kalland <kim.kalland@nokia.com> | 2011-05-11 14:14:07 (GMT) |
commit | 4d2edca95edbb93fb7c79c4ddb19e12cc4416ff2 (patch) | |
tree | b5d6d0d72901551fe2b88f0fef5159af6e5228b8 /src | |
parent | 8a5e82732be3aac37d14ef85c6974add46c6b65f (diff) | |
download | Qt-4d2edca95edbb93fb7c79c4ddb19e12cc4416ff2.zip Qt-4d2edca95edbb93fb7c79c4ddb19e12cc4416ff2.tar.gz Qt-4d2edca95edbb93fb7c79c4ddb19e12cc4416ff2.tar.bz2 |
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.cpp | 33 |
1 files changed, 20 insertions, 13 deletions
diff --git a/src/opengl/qglfunctions.cpp b/src/opengl/qglfunctions.cpp index be8219a..9137e0f 100644 --- a/src/opengl/qglfunctions.cpp +++ b/src/opengl/qglfunctions.cpp @@ -211,19 +211,24 @@ 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; + QGLExtensionMatcher extensions; + 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 +245,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; |