summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorRhys Weatherley <rhys.weatherley@nokia.com>2009-09-14 01:53:23 (GMT)
committerRhys Weatherley <rhys.weatherley@nokia.com>2009-09-14 01:53:23 (GMT)
commitc54541adf74bb8a87fd59d31f7e96626d3ca5e43 (patch)
tree2eea4683b5a0918b54796f0610194544c59abfc3 /examples
parentc151b747e0d7b45e0c7d5de6964b9dfef207d833 (diff)
downloadQt-c54541adf74bb8a87fd59d31f7e96626d3ca5e43.zip
Qt-c54541adf74bb8a87fd59d31f7e96626d3ca5e43.tar.gz
Qt-c54541adf74bb8a87fd59d31f7e96626d3ca5e43.tar.bz2
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')
-rw-r--r--examples/opengl/hellogl_es2/glwidget.cpp4
1 files changed, 0 insertions, 4 deletions
diff --git a/examples/opengl/hellogl_es2/glwidget.cpp b/examples/opengl/hellogl_es2/glwidget.cpp
index 5200467..a31c34a 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 );