diff options
author | Rhys Weatherley <rhys.weatherley@nokia.com> | 2009-09-14 11:53:23 +1000 |
---|---|---|
committer | Rhys Weatherley <rhys.weatherley@nokia.com> | 2009-09-14 11:53:23 +1000 |
commit | c54541adf74bb8a87fd59d31f7e96626d3ca5e43 (patch) | |
tree | 2eea4683b5a0918b54796f0610194544c59abfc3 /examples/opengl/hellogl_es2 | |
parent | c151b747e0d7b45e0c7d5de6964b9dfef207d833 (diff) | |
download | qt4-tools-c54541adf74bb8a87fd59d31f7e96626d3ca5e43.tar.gz |
Don't have to glEnable(GL_TEXTURE_2D) when using shaders.
OpenGL/ES 2.0 systems were giving a GL error when GL_TEXTURE_2D
was enabled and disabled.
Reviewed-by: trustme
Diffstat (limited to 'examples/opengl/hellogl_es2')
-rw-r--r-- | examples/opengl/hellogl_es2/glwidget.cpp | 4 |
1 files changed, 0 insertions, 4 deletions
diff --git a/examples/opengl/hellogl_es2/glwidget.cpp b/examples/opengl/hellogl_es2/glwidget.cpp index 5200467fb2..a31c34a3c0 100644 --- a/examples/opengl/hellogl_es2/glwidget.cpp +++ b/examples/opengl/hellogl_es2/glwidget.cpp @@ -92,7 +92,6 @@ void GLWidget::showBubbles(bool bubbles) void GLWidget::paintQtLogo() { - glDisable(GL_TEXTURE_2D); program1.setAttributeArray(vertexAttr1, vertices.constData()); program1.setAttributeArray(normalAttr1, normals.constData()); glDrawArrays(GL_TRIANGLES, 0, vertices.size()); @@ -102,7 +101,6 @@ void GLWidget::paintQtLogo() void GLWidget::paintTexturedCube() { - glEnable(GL_TEXTURE_2D); glBindTexture(GL_TEXTURE_2D, m_uiTexture); GLfloat afVertices[] = { -0.5, 0.5, 0.5, 0.5,-0.5,0.5,-0.5,-0.5,0.5, @@ -172,7 +170,6 @@ void GLWidget::initializeGL () { glClearColor(0.1f, 0.1f, 0.2f, 1.0f); - glEnable(GL_TEXTURE_2D); glGenTextures(1, &m_uiTexture); m_uiTexture = bindTexture(QImage(":/qt.png")); @@ -270,7 +267,6 @@ void GLWidget::paintGL() glClearColor(0.1f, 0.1f, 0.2f, 1.0f); glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); - glEnable(GL_TEXTURE_2D); glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR ); glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR ); |