[657/906] filterapp: port to non-glew

This commit is contained in:
Matthew Waters 2013-01-31 23:31:09 +11:00
parent b97fb42b30
commit a61423c7a2

View file

@ -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);
}