From 697309fc48d6ba9495f9b71eac19cc1c0dbf9690 Mon Sep 17 00:00:00 2001 From: wm4 Date: Fri, 30 Jan 2015 14:02:09 +0100 Subject: vo_opengl: use triangle strip for video A small simplification. Couldn't be done before, because it was also used by the OSD code, which required disjoint quads in a single draw call. Also mess with the unrelated code in gl_osd.c to simplify it a little as well. --- video/out/gl_osd.c | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) (limited to 'video/out/gl_osd.c') diff --git a/video/out/gl_osd.c b/video/out/gl_osd.c index 92d9a9a5ce..117d7feedb 100644 --- a/video/out/gl_osd.c +++ b/video/out/gl_osd.c @@ -265,19 +265,13 @@ static struct mpgl_osd_part *mpgl_osd_generate(struct mpgl_osd *ctx, static void write_quad(struct vertex *va, float x0, float y0, float x1, float y1, float tx0, float ty0, float tx1, float ty1, - float texture_w, float texture_h, - const uint8_t color[4]) + float tex_w, float tex_h, const uint8_t color[4]) { - tx0 /= texture_w; - ty0 /= texture_h; - tx1 /= texture_w; - ty1 /= texture_h; - #define COLOR_INIT {color[0], color[1], color[2], color[3]} - va[0] = (struct vertex) { {x0, y0}, COLOR_INIT, {tx0, ty0} }; - va[1] = (struct vertex) { {x0, y1}, COLOR_INIT, {tx0, ty1} }; - va[2] = (struct vertex) { {x1, y0}, COLOR_INIT, {tx1, ty0} }; - va[3] = (struct vertex) { {x1, y1}, COLOR_INIT, {tx1, ty1} }; + va[0] = (struct vertex){ {x0, y0}, COLOR_INIT, {tx0 / tex_w, ty0 / tex_h} }; + va[1] = (struct vertex){ {x0, y1}, COLOR_INIT, {tx0 / tex_w, ty1 / tex_h} }; + va[2] = (struct vertex){ {x1, y0}, COLOR_INIT, {tx1 / tex_w, ty0 / tex_h} }; + va[3] = (struct vertex){ {x1, y1}, COLOR_INIT, {tx1 / tex_w, ty1 / tex_h} }; va[4] = va[2]; va[5] = va[1]; #undef COLOR_INIT -- cgit v1.2.3