From a61423c7a20df5d168bbb0392820e013ec4c1fd0 Mon Sep 17 00:00:00 2001 From: Matthew Waters Date: Thu, 31 Jan 2013 23:31:09 +1100 Subject: [PATCH] [657/906] filterapp: port to non-glew --- gst/gl/gstglfilterapp.c | 30 ++++++------------------------ 1 file changed, 6 insertions(+), 24 deletions(-) diff --git a/gst/gl/gstglfilterapp.c b/gst/gl/gstglfilterapp.c index c89ef2ae09..e98bc53af1 100644 --- a/gst/gl/gstglfilterapp.c +++ b/gst/gl/gstglfilterapp.c @@ -193,7 +193,7 @@ gst_gl_filter_app_filter_texture (GstGLFilter * filter, guint in_tex, else { //blocking call, use a FBO gst_gl_filter_render_to_target (filter, TRUE, in_tex, out_tex, - gst_gl_filter_app_callback, NULL); + gst_gl_filter_app_callback, filter); } return TRUE; @@ -204,29 +204,11 @@ static void gst_gl_filter_app_callback (gint width, gint height, guint texture, gpointer stuff) { - glEnable (GL_TEXTURE_RECTANGLE_ARB); - glBindTexture (GL_TEXTURE_RECTANGLE_ARB, texture); - glTexParameteri (GL_TEXTURE_RECTANGLE_ARB, GL_TEXTURE_MAG_FILTER, GL_LINEAR); - glTexParameteri (GL_TEXTURE_RECTANGLE_ARB, GL_TEXTURE_MIN_FILTER, GL_LINEAR); - glTexParameteri (GL_TEXTURE_RECTANGLE_ARB, GL_TEXTURE_WRAP_S, - GL_CLAMP_TO_EDGE); - glTexParameteri (GL_TEXTURE_RECTANGLE_ARB, GL_TEXTURE_WRAP_T, - GL_CLAMP_TO_EDGE); - glTexEnvi (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE); + GstGLFilter *filter = GST_GL_FILTER (stuff); + GstGLFuncs *gl = filter->display->gl_vtable; - glClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); + gl->MatrixMode (GL_PROJECTION); + gl->LoadIdentity (); - glMatrixMode (GL_PROJECTION); - glLoadIdentity (); - - glBegin (GL_QUADS); - glTexCoord2i (0, 0); - glVertex2f (-1.0f, -1.0f); - glTexCoord2i (width, 0); - glVertex2f (1.0f, -1.0f); - glTexCoord2i (width, height); - glVertex2f (1.0f, 1.0f); - glTexCoord2i (0, height); - glVertex2f (-1.0f, 1.0f); - glEnd (); + gst_gl_filter_draw_texture (filter, texture, width, height); }