summaryrefslogtreecommitdiffstats
path: root/src/opengl/qgl.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/opengl/qgl.cpp')
-rw-r--r--src/opengl/qgl.cpp57
1 files changed, 29 insertions, 28 deletions
diff --git a/src/opengl/qgl.cpp b/src/opengl/qgl.cpp
index 1bd1b91..b6f8919 100644
--- a/src/opengl/qgl.cpp
+++ b/src/opengl/qgl.cpp
@@ -397,8 +397,7 @@ static inline GLint qgluProject(GLdouble objx, GLdouble objy, GLdouble objz,
\i \link setDirectRendering() Direct rendering:\endlink Enabled.
\i \link setOverlay() Overlay:\endlink Disabled.
\i \link setPlane() Plane:\endlink 0 (i.e., normal plane).
- \i \link setSampleBuffers() Multisample buffers:\endlink Enabled on
- OpenGL/ES 2.0, disabled on other platforms.
+ \i \link setSampleBuffers() Multisample buffers:\endlink Disabled.
\endlist
*/
@@ -4823,38 +4822,39 @@ QGLWidget::QGLWidget(QGLContext *context, QWidget *parent,
void QGLExtensions::init_extensions()
{
- QList<QByteArray> extensions = QByteArray(reinterpret_cast<const char *>(glGetString(GL_EXTENSIONS))).split(' ');
- if (extensions.contains("GL_ARB_texture_rectangle"))
+ QGLExtensionMatcher extensions(reinterpret_cast<const char *>(glGetString(GL_EXTENSIONS)));
+
+ if (extensions.match("GL_ARB_texture_rectangle"))
glExtensions |= TextureRectangle;
- if (extensions.contains("GL_ARB_multisample"))
+ if (extensions.match("GL_ARB_multisample"))
glExtensions |= SampleBuffers;
- if (extensions.contains("GL_SGIS_generate_mipmap"))
+ if (extensions.match("GL_SGIS_generate_mipmap"))
glExtensions |= GenerateMipmap;
- if (extensions.contains("GL_ARB_texture_compression"))
+ if (extensions.match("GL_ARB_texture_compression"))
glExtensions |= TextureCompression;
- if (extensions.contains("GL_EXT_texture_compression_s3tc"))
+ if (extensions.match("GL_EXT_texture_compression_s3tc"))
glExtensions |= DDSTextureCompression;
- if (extensions.contains("GL_OES_compressed_ETC1_RGB8_texture"))
+ if (extensions.match("GL_OES_compressed_ETC1_RGB8_texture"))
glExtensions |= ETC1TextureCompression;
- if (extensions.contains("GL_IMG_texture_compression_pvrtc"))
+ if (extensions.match("GL_IMG_texture_compression_pvrtc"))
glExtensions |= PVRTCTextureCompression;
- if (extensions.contains("GL_ARB_fragment_program"))
+ if (extensions.match("GL_ARB_fragment_program"))
glExtensions |= FragmentProgram;
- if (extensions.contains("GL_ARB_fragment_shader"))
+ if (extensions.match("GL_ARB_fragment_shader"))
glExtensions |= FragmentShader;
- if (extensions.contains("GL_ARB_texture_mirrored_repeat"))
+ if (extensions.match("GL_ARB_texture_mirrored_repeat"))
glExtensions |= MirroredRepeat;
- if (extensions.contains("GL_EXT_framebuffer_object"))
+ if (extensions.match("GL_EXT_framebuffer_object"))
glExtensions |= FramebufferObject;
- if (extensions.contains("GL_EXT_stencil_two_side"))
+ if (extensions.match("GL_EXT_stencil_two_side"))
glExtensions |= StencilTwoSide;
- if (extensions.contains("GL_EXT_stencil_wrap"))
+ if (extensions.match("GL_EXT_stencil_wrap"))
glExtensions |= StencilWrap;
- if (extensions.contains("GL_EXT_packed_depth_stencil"))
+ if (extensions.match("GL_EXT_packed_depth_stencil"))
glExtensions |= PackedDepthStencil;
- if (extensions.contains("GL_NV_float_buffer"))
+ if (extensions.match("GL_NV_float_buffer"))
glExtensions |= NVFloatBuffer;
- if (extensions.contains("GL_ARB_pixel_buffer_object"))
+ if (extensions.match("GL_ARB_pixel_buffer_object"))
glExtensions |= PixelBufferObject;
#if defined(QT_OPENGL_ES_2)
glExtensions |= FramebufferObject;
@@ -4862,26 +4862,26 @@ void QGLExtensions::init_extensions()
glExtensions |= FragmentShader;
#endif
#if defined(QT_OPENGL_ES_1) || defined(QT_OPENGL_ES_1_CL)
- if (extensions.contains("GL_OES_framebuffer_object"))
+ if (extensions.match("GL_OES_framebuffer_object"))
glExtensions |= FramebufferObject;
#endif
#if defined(QT_OPENGL_ES)
- if (extensions.contains("GL_OES_packed_depth_stencil"))
+ if (extensions.match("GL_OES_packed_depth_stencil"))
glExtensions |= PackedDepthStencil;
#endif
- if (extensions.contains("GL_ARB_framebuffer_object")) {
+ if (extensions.match("GL_ARB_framebuffer_object")) {
// ARB_framebuffer_object also includes EXT_framebuffer_blit.
glExtensions |= FramebufferObject;
glExtensions |= FramebufferBlit;
}
- if (extensions.contains("GL_EXT_framebuffer_blit"))
+ if (extensions.match("GL_EXT_framebuffer_blit"))
glExtensions |= FramebufferBlit;
- if (extensions.contains("GL_ARB_texture_non_power_of_two"))
+ if (extensions.match("GL_ARB_texture_non_power_of_two"))
glExtensions |= NPOTTextures;
- if (extensions.contains("GL_EXT_bgra"))
+ if (extensions.match("GL_EXT_bgra"))
glExtensions |= BGRATextureFormat;
}
@@ -5363,11 +5363,12 @@ QSize QGLTexture::bindCompressedTexturePVR(const char *buf, int len)
// Restore the default pixel alignment for later texture uploads.
glPixelStorei(GL_UNPACK_ALIGNMENT, 4);
- // Set the invert flag for the texture.
+ // Set the invert flag for the texture. The "vertical flip"
+ // flag in PVR is the opposite sense to our sense of inversion.
if ((pvrHeader->flags & PVR_VERTICAL_FLIP) != 0)
- options |= QGLContext::InvertedYBindOption;
- else
options &= ~QGLContext::InvertedYBindOption;
+ else
+ options |= QGLContext::InvertedYBindOption;
return QSize(pvrHeader->width, pvrHeader->height);
}