diff options
author | Rhys Weatherley <rhys.weatherley@nokia.com> | 2009-09-14 03:26:25 (GMT) |
---|---|---|
committer | Rhys Weatherley <rhys.weatherley@nokia.com> | 2009-09-14 03:26:25 (GMT) |
commit | 7809276c405d4b32eb671737ea0967b673ea271c (patch) | |
tree | 1ecf9ac156a8b1b8e17d767fbc8bef8fc61bb482 /src | |
parent | c54541adf74bb8a87fd59d31f7e96626d3ca5e43 (diff) | |
download | Qt-7809276c405d4b32eb671737ea0967b673ea271c.zip Qt-7809276c405d4b32eb671737ea0967b673ea271c.tar.gz Qt-7809276c405d4b32eb671737ea0967b673ea271c.tar.bz2 |
Use redF(), etc when setting GL colors
Reviewed-by: Sarah Smith
Diffstat (limited to 'src')
-rw-r--r-- | src/opengl/qgl.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/opengl/qgl.cpp b/src/opengl/qgl.cpp index 1bcfab8..f8a88601 100644 --- a/src/opengl/qgl.cpp +++ b/src/opengl/qgl.cpp @@ -3983,7 +3983,7 @@ void QGLWidget::qglColor(const QColor& c) const { #if !defined(QT_OPENGL_ES_2) #ifdef QT_OPENGL_ES - glColor4f(c.red()/255.0, c.green()/255.0, c.blue()/255.0, c.alpha()/255.0); + glColor4f(c.redF(), c.greenF(), c.blueF(), c.alphaF()); #else Q_D(const QGLWidget); const QGLContext *ctx = QGLContext::currentContext(); @@ -4015,15 +4015,13 @@ void QGLWidget::qglColor(const QColor& c) const void QGLWidget::qglClearColor(const QColor& c) const { #ifdef QT_OPENGL_ES - glClearColor((GLfloat)c.red() / 255.0, (GLfloat)c.green() / 255.0, - (GLfloat)c.blue() / 255.0, (GLfloat) c.alpha() / 255.0); + glClearColor(c.redF(), c.greenF(), c.blueF(), c.alphaF()); #else Q_D(const QGLWidget); const QGLContext *ctx = QGLContext::currentContext(); if (ctx) { if (ctx->format().rgba()) - glClearColor((GLfloat)c.red() / 255.0, (GLfloat)c.green() / 255.0, - (GLfloat)c.blue() / 255.0, (GLfloat) c.alpha() / 255.0); + glClearColor(c.redF(), c.greenF(), c.blueF(), c.alphaF()); else if (!d->cmap.isEmpty()) { // QGLColormap in use? int i = d->cmap.find(c.rgb()); if (i < 0) |