summaryrefslogtreecommitdiffstats
path: root/src/opengl/gl2paintengineex/qglengineshadermanager_p.h
diff options
context:
space:
mode:
authorKim Motoyoshi Kalland <kim.kalland@nokia.com>2009-07-20 10:41:47 (GMT)
committerKim Motoyoshi Kalland <kim.kalland@nokia.com>2009-07-21 13:54:48 (GMT)
commit8c97cd7a91e99a2665e871efe1bf577e33eaff3a (patch)
tree3464c28b1f850d6d1d194bb881f3cdecaa9daab1 /src/opengl/gl2paintengineex/qglengineshadermanager_p.h
parent40649c420601bcc1f639fc8b337bfd7375d2b37e (diff)
downloadQt-8c97cd7a91e99a2665e871efe1bf577e33eaff3a.zip
Qt-8c97cd7a91e99a2665e871efe1bf577e33eaff3a.tar.gz
Qt-8c97cd7a91e99a2665e871efe1bf577e33eaff3a.tar.bz2
Fixed GL2 engine shader manager to work with more than one context.
I added a QGLContextResource class which can be used internally in Qt for sharing resources between contexts. The QGLContextResource is a hash map where the context is used as 'key', and the resource is the 'value'. All the sharing contexts point to the same resource, and the resource is automatically deleted when it is not referenced any more. Now, the shader manager uses the QGLContextResource class. I also added a pointer to a struct in the QGLContextPrivate class. The struct is shared between all the sharing contexts and is deleted automatically. Currently, the struct only contains the resolved OpenGL function pointers. The shared context register code has been simplified. Reviewed-by: Tom
Diffstat (limited to 'src/opengl/gl2paintengineex/qglengineshadermanager_p.h')
-rw-r--r--src/opengl/gl2paintengineex/qglengineshadermanager_p.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/opengl/gl2paintengineex/qglengineshadermanager_p.h b/src/opengl/gl2paintengineex/qglengineshadermanager_p.h
index 442edfe..99711bd40 100644
--- a/src/opengl/gl2paintengineex/qglengineshadermanager_p.h
+++ b/src/opengl/gl2paintengineex/qglengineshadermanager_p.h
@@ -220,6 +220,7 @@
#include <QGLShader>
#include <QGLShaderProgram>
#include <QPainter>
+#include <private/qgl_p.h>
QT_BEGIN_HEADER
@@ -314,6 +315,8 @@ public:
QGLShaderProgram* simpleProgram(); // Used to draw into e.g. stencil buffers
QGLShaderProgram* blitProgram(); // Used to blit a texture into the framebuffer
+ static QGLEngineShaderManager *managerForContext(const QGLContext *context);
+
enum ShaderName {
MainVertexShader,
MainWithTexCoordsVertexShader,