examples/gl/qt: fix the examples for the use of newer API
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
This commit is contained in:
parent
85feb6d6f2
commit
263255137e
@ -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);
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user