summaryrefslogtreecommitdiffstats
path: root/examples/opengl/shared/qtlogo.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'examples/opengl/shared/qtlogo.cpp')
-rw-r--r--examples/opengl/shared/qtlogo.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/examples/opengl/shared/qtlogo.cpp b/examples/opengl/shared/qtlogo.cpp
index 3294da1bbf..b32b416a92 100644
--- a/examples/opengl/shared/qtlogo.cpp
+++ b/examples/opengl/shared/qtlogo.cpp
@@ -172,14 +172,17 @@ static inline void qMultMatrix(const QMatrix4x4 &mat)
{
if (sizeof(qreal) == sizeof(GLfloat))
glMultMatrixf((GLfloat*)mat.constData());
+#ifndef QT_OPENGL_ES
else if (sizeof(qreal) == sizeof(GLdouble))
glMultMatrixd((GLdouble*)mat.constData());
+#endif
else
{
GLfloat fmat[16];
qreal const *r = mat.constData();
for (int i = 0; i < 16; ++i)
fmat[i] = r[i];
+ glMultMatrixf(fmat);
}
}
@@ -188,7 +191,7 @@ void Patch::draw() const
{
glPushMatrix();
qMultMatrix(mat);
- glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, faceColor);
+ glMaterialfv(GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE, faceColor);
const GLushort *indices = geom->faces.constData();
glDrawElements(GL_TRIANGLES, count, GL_UNSIGNED_SHORT, indices + start);