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
This commit is contained in:
Kim Motoyoshi Kalland 2011-05-11 10:53:00 +02:00
parent fda40e37df
commit 7fce0a73cc

View File

@ -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;