summaryrefslogtreecommitdiffstats
path: root/examples/widgets/graphicsview/boxes
diff options
context:
space:
mode:
Diffstat (limited to 'examples/widgets/graphicsview/boxes')
-rw-r--r--examples/widgets/graphicsview/boxes/scene.cpp16
1 files changed, 3 insertions, 13 deletions
diff --git a/examples/widgets/graphicsview/boxes/scene.cpp b/examples/widgets/graphicsview/boxes/scene.cpp
index 5fb43d8c99..cf0b021b47 100644
--- a/examples/widgets/graphicsview/boxes/scene.cpp
+++ b/examples/widgets/graphicsview/boxes/scene.cpp
@@ -655,22 +655,12 @@ static void loadMatrix(const QMatrix4x4& m)
{
// static to prevent glLoadMatrixf to fail on certain drivers
static GLfloat mat[16];
- const qreal *data = m.constData();
+ const float *data = m.constData();
for (int index = 0; index < 16; ++index)
mat[index] = data[index];
glLoadMatrixf(mat);
}
-static void multMatrix(const QMatrix4x4& m)
-{
- // 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];
- glMultMatrixf(mat);
-}
-
// If one of the boxes should not be rendered, set excludeBox to its index.
// If the main box should not be rendered, set excludeBox to -1.
void Scene::renderBoxes(const QMatrix4x4 &view, int excludeBox)
@@ -722,7 +712,7 @@ void Scene::renderBoxes(const QMatrix4x4 &view, int excludeBox)
glPushMatrix();
QMatrix4x4 m;
m.rotate(m_trackBalls[1].rotation());
- multMatrix(m);
+ glMultMatrixf(m.constData());
glRotatef(360.0f * i / m_programs.size(), 0.0f, 0.0f, 1.0f);
glTranslatef(2.0f, 0.0f, 0.0f);
@@ -755,7 +745,7 @@ void Scene::renderBoxes(const QMatrix4x4 &view, int excludeBox)
if (-1 != excludeBox) {
QMatrix4x4 m;
m.rotate(m_trackBalls[0].rotation());
- multMatrix(m);
+ glMultMatrixf(m.constData());
if (glActiveTexture) {
if (m_dynamicCubemap)