mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-24 18:51:11 +00:00
[662/906] laplacian: port to non-glew
This commit is contained in:
parent
753dfca775
commit
d255b55115
1 changed files with 9 additions and 16 deletions
|
@ -189,33 +189,26 @@ static void
|
||||||
gst_gl_filter_laplacian_callback (gint width, gint height, guint texture,
|
gst_gl_filter_laplacian_callback (gint width, gint height, guint texture,
|
||||||
gpointer stuff)
|
gpointer stuff)
|
||||||
{
|
{
|
||||||
GstGLFilterLaplacian *laplacian_filter = GST_GL_FILTER_LAPLACIAN (stuff);
|
GstGLFilter *filter = GST_GL_FILTER (stuff);
|
||||||
|
GstGLFilterLaplacian *laplacian_filter = GST_GL_FILTER_LAPLACIAN (filter);
|
||||||
|
GstGLFuncs *gl = filter->display->gl_vtable;
|
||||||
|
|
||||||
gfloat kernel[9] = { 0.0, -1.0, 0.0,
|
gfloat kernel[9] = { 0.0, -1.0, 0.0,
|
||||||
-1.0, 4.0, -1.0,
|
-1.0, 4.0, -1.0,
|
||||||
0.0, -1.0, 0.0
|
0.0, -1.0, 0.0
|
||||||
};
|
};
|
||||||
|
|
||||||
glMatrixMode (GL_PROJECTION);
|
gl->MatrixMode (GL_PROJECTION);
|
||||||
glLoadIdentity ();
|
gl->LoadIdentity ();
|
||||||
|
|
||||||
gst_gl_shader_use (laplacian_filter->shader);
|
gst_gl_shader_use (laplacian_filter->shader);
|
||||||
|
|
||||||
glActiveTexture (GL_TEXTURE0);
|
gl->ActiveTexture (GL_TEXTURE0);
|
||||||
glEnable (GL_TEXTURE_RECTANGLE_ARB);
|
gl->Enable (GL_TEXTURE_RECTANGLE_ARB);
|
||||||
glBindTexture (GL_TEXTURE_RECTANGLE_ARB, texture);
|
gl->BindTexture (GL_TEXTURE_RECTANGLE_ARB, texture);
|
||||||
|
|
||||||
gst_gl_shader_set_uniform_1i (laplacian_filter->shader, "tex", 0);
|
gst_gl_shader_set_uniform_1i (laplacian_filter->shader, "tex", 0);
|
||||||
gst_gl_shader_set_uniform_1fv (laplacian_filter->shader, "kernel", 9, kernel);
|
gst_gl_shader_set_uniform_1fv (laplacian_filter->shader, "kernel", 9, kernel);
|
||||||
|
|
||||||
glBegin (GL_QUADS);
|
gst_gl_filter_draw_texture (filter, texture, width, height);
|
||||||
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 ();
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue