diff options
author | Samuel Rødal <sroedal@trolltech.com> | 2010-01-07 11:26:38 (GMT) |
---|---|---|
committer | Samuel Rødal <sroedal@trolltech.com> | 2010-01-07 11:28:52 (GMT) |
commit | 443d2f28f5ee83c4ab8353c2c8608139735e1f48 (patch) | |
tree | eef15aa76a1eca83766bf8ec886e66e68fa50bfa /demos/boxes | |
parent | 2e4c7797144ff2487eadd4c4ae076943c1b7d409 (diff) | |
download | Qt-443d2f28f5ee83c4ab8353c2c8608139735e1f48.zip Qt-443d2f28f5ee83c4ab8353c2c8608139735e1f48.tar.gz Qt-443d2f28f5ee83c4ab8353c2c8608139735e1f48.tar.bz2 |
Fixed bug in boxes demo occuring with certain OpenGL drivers.
Apparently glLoadMatrixf doesn't load the supplied data synchronously in
certain drivers, so we make the arrays static to work around this issue.
Really a GL driver bug but it's quite simple to work around it in this
case.
Reviewed-by: Kim
Diffstat (limited to 'demos/boxes')
-rw-r--r-- | demos/boxes/scene.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/demos/boxes/scene.cpp b/demos/boxes/scene.cpp index 452f4ef..9b36b81 100644 --- a/demos/boxes/scene.cpp +++ b/demos/boxes/scene.cpp @@ -653,7 +653,8 @@ void Scene::initGL() static void loadMatrix(const QMatrix4x4& m) { - GLfloat mat[16]; + // static to prevent glLoadMatrixf to fail on certain drivers + static GLfloat mat[16]; const qreal *data = m.constData(); for (int index = 0; index < 16; ++index) mat[index] = data[index]; @@ -662,7 +663,8 @@ static void loadMatrix(const QMatrix4x4& m) static void multMatrix(const QMatrix4x4& m) { - GLfloat mat[16]; + // static to prevent glMultMatrixf to fail on certain drivers + static GLfloat mat[16]; const qreal *data = m.constData(); for (int index = 0; index < 16; ++index) mat[index] = data[index]; |