examples/gl/qt: fix the examples for the use of newer API
authorMatthew Waters <matthew@centricular.com>
Tue, 8 Nov 2016 04:04:29 +0000 (15:04 +1100)
committerMatthew Waters <matthew@centricular.com>
Tue, 8 Nov 2016 04:14:27 +0000 (15:14 +1100)
gstgl doesn't undo/overwrite what GL state the examples are changing
anymore.  As such, the examples need to reset the GL state themselves
to be able to play nice with libgstgl

tests/examples/gl/qt/mousevideooverlay/pipeline.cpp
tests/examples/gl/qt/qglwidgetvideooverlay/pipeline.cpp
tests/examples/gl/qt/qglwtextureshare/qglrenderer.cpp

index 51cc345..28d8cf8 100644 (file)
@@ -255,7 +255,11 @@ gboolean Pipeline::drawCallback (void * sink, void *context, GstSample * sample,
              glTexCoord2f(0.0f, 0.0f); glVertex3f(-1.0f, -1.0f,  1.0f);
              glTexCoord2f(0.0f, 1.0f); glVertex3f(-1.0f,  1.0f,  1.0f);
              glTexCoord2f(1.0f, 1.0f); glVertex3f(-1.0f,  1.0f, -1.0f);
-    glEnd(); 
+    glEnd();
+
+    glLoadIdentity();
+    glDisable(GL_DEPTH_TEST);
+    glBindTexture (GL_TEXTURE_2D, 0);
 
     gst_video_frame_unmap (&v_frame);
 
index daf246a..301d3b6 100644 (file)
@@ -242,6 +242,10 @@ gboolean Pipeline::drawCallback (GstElement * gl_sink, void *context, GstSample
              glTexCoord2f(1.0, 1.0f); glVertex3f(-1.0f,  1.0f, -1.0f);
     glEnd();
 
+    glLoadIdentity();
+    glDisable(GL_DEPTH_TEST);
+    glBindTexture (GL_TEXTURE_2D, 0);
+
     gst_video_frame_unmap (&v_frame);
 
        xrot+=0.03f;
index ee9c61e..629cc89 100644 (file)
@@ -28,7 +28,7 @@
 #include <GL/glx.h>
 
 #include <gst/video/video.h>
-#include <gst/gl/gstglmemory.h>
+#include <gst/gl/gl.h>
 
 #if GST_GL_HAVE_PLATFORM_GLX
 #include <QX11Info>
@@ -266,6 +266,8 @@ QGLRenderer::paintGL ()
     yrot += 0.2f;
     zrot += 0.4f;
 
+    glLoadIdentity();
+    glDisable(GL_DEPTH_TEST);
     glBindTexture (GL_TEXTURE_2D, 0);
 
     gst_video_frame_unmap (&v_frame);