gl/examples: fixup generic cube example for NDC
authorMatthew Waters <matthew@centricular.com>
Sat, 14 Mar 2015 18:10:24 +0000 (18:10 +0000)
committerTim-Philipp Müller <tim@centricular.com>
Sat, 9 Dec 2017 19:31:58 +0000 (19:31 +0000)
translating outside the clip region doesn't work

tests/examples/gl/generic/cube/main.cpp

index c3ace9f..3a54fe6 100644 (file)
@@ -120,7 +120,7 @@ static gboolean drawCallback (GstElement * gl_sink, GstGLContext *context, GstSa
     glMatrixMode(GL_MODELVIEW);
     glLoadIdentity();
 
-    glTranslatef(0.0f,0.0f,-5.0f);
+    glScalef(0.5f,0.5f,0.5f);
 
     glRotatef(xrot,1.0f,0.0f,0.0f);
     glRotatef(yrot,0.0f,1.0f,0.0f);
@@ -165,6 +165,9 @@ static gboolean drawCallback (GstElement * gl_sink, GstGLContext *context, GstSa
     yrot+=0.2f;
     zrot+=0.4f;
 
+    glDisable (GL_DEPTH_TEST);
+    glDisable (GL_TEXTURE_2D);
+
     return TRUE;
 }