Add gdk_gl_texture_quad() helper
Right now this just centralizes the glBegin/glEnd code, but this will be replaced with buffer objects later.
This commit is contained in:
		| @ -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, | ||||
|  | ||||
		Reference in New Issue
	
	Block a user
	 Alexander Larsson
					Alexander Larsson