diff options
author | Rhys Weatherley <rhys.weatherley@nokia.com> | 2009-09-21 02:40:34 (GMT) |
---|---|---|
committer | Rhys Weatherley <rhys.weatherley@nokia.com> | 2009-09-21 02:40:52 (GMT) |
commit | 8db9f834e604c3a9eda8f76eacad2a9af20dbd33 (patch) | |
tree | 0d1e7ac8df6aae69cc878f605472ffb9db3a01ae /examples/opengl/shared/qtlogo.cpp | |
parent | 544900b98b2ea996f5dccc65402bb9f32b89a3c2 (diff) | |
download | Qt-8db9f834e604c3a9eda8f76eacad2a9af20dbd33.zip Qt-8db9f834e604c3a9eda8f76eacad2a9af20dbd33.tar.gz Qt-8db9f834e604c3a9eda8f76eacad2a9af20dbd33.tar.bz2 |
Make OpenGL overpainting example compile under OpenGL/ES 1.1
Reviewed-by: trustme
Diffstat (limited to 'examples/opengl/shared/qtlogo.cpp')
-rw-r--r-- | examples/opengl/shared/qtlogo.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/examples/opengl/shared/qtlogo.cpp b/examples/opengl/shared/qtlogo.cpp index 3294da1..b32b416 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); |