From 404e6cf0816a3bd52d8c90101be254ad0d299bf5 Mon Sep 17 00:00:00 2001 From: Thomas Goyne Date: Mon, 5 Oct 2009 20:50:04 +0000 Subject: [PATCH] Add support for flipped video to new video renderer. Originally committed to SVN as r3617. --- aegisub/src/video_out_gl.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/aegisub/src/video_out_gl.cpp b/aegisub/src/video_out_gl.cpp index cc811a5ef..1a9492cef 100644 --- a/aegisub/src/video_out_gl.cpp +++ b/aegisub/src/video_out_gl.cpp @@ -233,11 +233,17 @@ void VideoOutGL::DisplayFrame(AegiVideoFrame frame, int sw, int sh) { glColor4f(1.0f, 1.0f, 1.0f, 1.0f); if (GLenum err = glGetError()) throw VideoOutOpenGLException(L"glColor4f", err); + float top = 0.0f; + float bottom = ti.texH; + if (frame.flipped) { + top = ti.texH; + bottom = 0.0f; + } glBegin(GL_QUADS); - glTexCoord2f(0.0, 0.0); glVertex2f(destX, destY); - glTexCoord2f(ti.texW, 0.0); glVertex2f(destX + destW, destY); - glTexCoord2f(ti.texW, ti.texH); glVertex2f(destX + destW, destY + destH); - glTexCoord2f(0.0, ti.texH); glVertex2f(destX, destY + destH); + glTexCoord2f(0.0f, top); glVertex2f(destX, destY); + glTexCoord2f(ti.texW, top); glVertex2f(destX + destW, destY); + glTexCoord2f(ti.texW, bottom); glVertex2f(destX + destW, destY + destH); + glTexCoord2f(0.0f, bottom); glVertex2f(destX, destY + destH); glEnd(); if (GLenum err = glGetError()) throw VideoOutOpenGLException(L"GL_QUADS", err); }