diff options
author | Alexander Larsson <alexl@redhat.com> | 2014-11-05 15:42:06 +0100 |
---|---|---|
committer | Alexander Larsson <alexl@redhat.com> | 2014-11-06 12:24:43 +0100 |
commit | 10a44e8f7ad4dd4fd4dd1ba3ef1e5f08ffcc6f87 (patch) | |
tree | 5eee356187688f27c05f3e4ac4e4089ff03fbc0c /gdk/x11/gdkglcontext-x11.c | |
parent | 3c34ca3405f852b554bc05e07e460dbe9b9eae59 (diff) | |
download | gtk+-10a44e8f7ad4dd4fd4dd1ba3ef1e5f08ffcc6f87.tar.gz |
Add gdk_gl_texture_quad() helper
Right now this just centralizes the glBegin/glEnd code, but
this will be replaced with buffer objects later.
Diffstat (limited to 'gdk/x11/gdkglcontext-x11.c')
-rw-r--r-- | gdk/x11/gdkglcontext-x11.c | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/gdk/x11/gdkglcontext-x11.c b/gdk/x11/gdkglcontext-x11.c index bc48d4d7e8..7b86a723be 100644 --- a/gdk/x11/gdkglcontext-x11.c +++ b/gdk/x11/gdkglcontext-x11.c @@ -469,19 +469,10 @@ gdk_x11_gl_context_texture_from_surface (GdkGLContext *context, vscale = 1.0 / cairo_xlib_surface_get_height (surface); } - glBegin (GL_QUADS); - glTexCoord2f (uscale * src_x, vscale * (src_y + src_height)); - glVertex2f (rect.x * window_scale, FLIP_Y(rect.y + rect.height) * window_scale); - - glTexCoord2f (uscale * (src_x + src_width), vscale * (src_y + src_height)); - glVertex2f ((rect.x + rect.width) * window_scale, FLIP_Y(rect.y + rect.height) * window_scale); - - glTexCoord2f (uscale * (src_x + src_width), vscale * src_y); - glVertex2f ((rect.x + rect.width) * window_scale, FLIP_Y(rect.y) * window_scale); - - glTexCoord2f (uscale * src_x, vscale * src_y); - glVertex2f (rect.x * window_scale, FLIP_Y(rect.y) * window_scale); - glEnd(); + gdk_gl_texture_quad (rect.x * window_scale, FLIP_Y(rect.y) * window_scale, + (rect.x + rect.width) * window_scale, FLIP_Y(rect.y + rect.height) * window_scale, + uscale * src_x, vscale * src_y, + uscale * (src_x + src_width), vscale * (src_y + src_height)); } glXReleaseTexImageEXT (glx_pixmap->display, glx_pixmap->drawable, |