diff options
author | Rhys Weatherley <rhys.weatherley@nokia.com> | 2009-12-03 00:07:22 (GMT) |
---|---|---|
committer | Rhys Weatherley <rhys.weatherley@nokia.com> | 2009-12-06 21:52:53 (GMT) |
commit | 147195bccfdf90924a1525398e9c7b3119c1e278 (patch) | |
tree | 1e75453e2952568a33083e2bd0f251c43c637431 /src/opengl/qglextensions_p.h | |
parent | 76c415b586991d978d46a888fb40c631513407dc (diff) | |
download | Qt-147195bccfdf90924a1525398e9c7b3119c1e278.zip Qt-147195bccfdf90924a1525398e9c7b3119c1e278.tar.gz Qt-147195bccfdf90924a1525398e9c7b3119c1e278.tar.bz2 |
Compressed texture binding for QtOpenGL: ETC1 and PVRTC
The QGLContext::bindTexture(QString) function has been augmented
with support for ETC1, PVRTC2, and PVRTC4 compressed textures,
in addition to the existing DDS support.
The QGLPixmapData class has also been modified to recognize
compressed texture formats in fromFile() and fromData().
This change also fixes a bug in bindTexture() that prevented
the same compressed texture file from being bound in multiple
contexts. There is now a separate file cache for each context group.
Task-number: QT-2547
Reviewed-by: Trond
Diffstat (limited to 'src/opengl/qglextensions_p.h')
-rw-r--r-- | src/opengl/qglextensions_p.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/opengl/qglextensions_p.h b/src/opengl/qglextensions_p.h index 3510765..62e216c 100644 --- a/src/opengl/qglextensions_p.h +++ b/src/opengl/qglextensions_p.h @@ -184,6 +184,10 @@ typedef void (APIENTRY *_glBlitFramebufferEXT) (int srcX0, int srcY0, int srcX1, typedef void (APIENTRY *_glRenderbufferStorageMultisampleEXT) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); +// ARB_texture_compression +typedef void (APIENTRY *_glCompressedTexImage2DARB) (GLenum, GLint, GLenum, GLsizei, + GLsizei, GLint, GLsizei, const GLvoid *); + QT_BEGIN_NAMESPACE struct QGLExtensionFuncs @@ -289,6 +293,11 @@ struct QGLExtensionFuncs #endif qt_glMapBufferARB = 0; qt_glUnmapBufferARB = 0; + +#if !defined(QT_OPENGL_ES) + // Texture compression + qt_glCompressedTexImage2DARB = 0; +#endif } @@ -397,6 +406,10 @@ struct QGLExtensionFuncs _glMapBufferARB qt_glMapBufferARB; _glUnmapBufferARB qt_glUnmapBufferARB; +#if !defined(QT_OPENGL_ES) + // Texture compression + _glCompressedTexImage2DARB qt_glCompressedTexImage2DARB; +#endif }; @@ -732,6 +745,10 @@ struct QGLExtensionFuncs #define glClearDepth glClearDepthf #endif +#if !defined(QT_OPENGL_ES) +#define glCompressedTexImage2D QGLContextPrivate::extensionFuncs(ctx).qt_glCompressedTexImage2DARB +#endif + extern bool qt_resolve_framebufferobject_extensions(QGLContext *ctx); bool qt_resolve_buffer_extensions(QGLContext *ctx); |