summaryrefslogtreecommitdiffstats
path: root/examples/opengl/cube/mainwidget.cpp
diff options
context:
space:
mode:
authorSamuel Rødal <[email protected]>2011-10-21 12:31:43 +0200
committerQt by Nokia <[email protected]>2011-10-28 12:14:10 +0200
commit77d30df7e546fecbefaccb6435f8ee9d53639cac (patch)
treeaa998a1d34d27456f5ad87efa513679ed3aead7e /examples/opengl/cube/mainwidget.cpp
parent0b77a19394725373bb8d23e9b240c85a4714ed1d (diff)
Get rid of legacy glTexParameterf calls.
ES 1.0 didn't have glTexParameteri, which is why we sometimes used glTexParameterf. However, we shouldn't use glTexParameterf because that's treating integer values as floating point, which is not type safe. ES 1.1+ and ES 2.x have glTexParameteri, and we don't really care about supporting ES 1.0 in any case in Qt 5. Change-Id: I6b586b31ddc418ba319c4cc88f6bb3978fdbd040 Reviewed-by: Kim M. Kalland <[email protected]>
Diffstat (limited to 'examples/opengl/cube/mainwidget.cpp')
-rw-r--r--examples/opengl/cube/mainwidget.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/examples/opengl/cube/mainwidget.cpp b/examples/opengl/cube/mainwidget.cpp
index 3f4e9214acf..eae31c375e5 100644
--- a/examples/opengl/cube/mainwidget.cpp
+++ b/examples/opengl/cube/mainwidget.cpp
@@ -179,15 +179,15 @@ void MainWidget::initTextures()
texture = bindTexture(QImage(":/cube.png"));
// Set nearest filtering mode for texture minification
- glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
// Set bilinear filtering mode for texture magnification
- glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
// Wrap texture coordinates by repeating
// f.ex. texture coordinate (1.1, 1.2) is same as (0.1, 0.2)
- glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
- glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
}
//! [4]