diff options
author | Rhys Weatherley <rhys.weatherley@nokia.com> | 2010-01-29 04:00:38 (GMT) |
---|---|---|
committer | Rhys Weatherley <rhys.weatherley@nokia.com> | 2010-02-01 00:54:27 (GMT) |
commit | 2f3bf7b546186b9415f2d0b97ae431fea1a2cc48 (patch) | |
tree | e5390bc3384f143740c506b64cd4549902b45ab8 /src/opengl/qglextensions.cpp | |
parent | c06c254cf208840f14c9e562cae976f1a61f0879 (diff) | |
download | Qt-2f3bf7b546186b9415f2d0b97ae431fea1a2cc48.zip Qt-2f3bf7b546186b9415f2d0b97ae431fea1a2cc48.tar.gz Qt-2f3bf7b546186b9415f2d0b97ae431fea1a2cc48.tar.bz2 |
Add the QGLBuffer class to Qt 4.7 for VBO's
Reviewed-by: Sarah Smith
Diffstat (limited to 'src/opengl/qglextensions.cpp')
-rw-r--r-- | src/opengl/qglextensions.cpp | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/src/opengl/qglextensions.cpp b/src/opengl/qglextensions.cpp index c091191..03fca39 100644 --- a/src/opengl/qglextensions.cpp +++ b/src/opengl/qglextensions.cpp @@ -191,31 +191,35 @@ bool qt_resolve_frag_program_extensions(QGLContext *ctx) bool qt_resolve_buffer_extensions(QGLContext *ctx) { - if (glMapBufferARB && glUnmapBufferARB -#if !defined(QT_OPENGL_ES_2) - && glBindBuffer && glDeleteBuffers && glGenBuffers && glBufferData -#endif - ) +#if defined(QGL_RESOLVE_BUFFER_FUNCS) + if (glBindBuffer && glDeleteBuffers && glGenBuffers && glBufferData + && glBufferSubData && glGetBufferParameteriv) return true; +#endif -#if !defined(QT_OPENGL_ES_2) +#if defined(QGL_RESOLVE_BUFFER_FUNCS) glBindBuffer = (_glBindBuffer) qt_gl_getProcAddressARB(ctx, "glBindBuffer"); glDeleteBuffers = (_glDeleteBuffers) qt_gl_getProcAddressARB(ctx, "glDeleteBuffers"); glGenBuffers = (_glGenBuffers) qt_gl_getProcAddressARB(ctx, "glGenBuffers"); glBufferData = (_glBufferData) qt_gl_getProcAddressARB(ctx, "glBufferData"); + glBufferSubData = (_glBufferSubData) qt_gl_getProcAddressARB(ctx, "glBufferSubData"); + glGetBufferSubData = (_glGetBufferSubData) qt_gl_getProcAddressARB(ctx, "glGetBufferSubData"); + glGetBufferParameteriv = (_glGetBufferParameteriv) qt_gl_getProcAddressARB(ctx, "glGetBufferParameteriv"); #endif glMapBufferARB = (_glMapBufferARB) qt_gl_getProcAddressARB(ctx, "glMapBuffer"); glUnmapBufferARB = (_glUnmapBufferARB) qt_gl_getProcAddressARB(ctx, "glUnmapBuffer"); - return glMapBufferARB - && glUnmapBufferARB -#if !defined(QT_OPENGL_ES_2) - && glBindBuffer +#if defined(QGL_RESOLVE_BUFFER_FUNCS) + return glBindBuffer && glDeleteBuffers && glGenBuffers && glBufferData + && glBufferSubData + && glGetBufferParameteriv; + // glGetBufferSubData() is optional +#else + return true; #endif - ; } bool qt_resolve_glsl_extensions(QGLContext *ctx) |