Skip to content

Commit

Permalink
gl: frame upside down with GLES 2.0 if video shift is on
Browse files Browse the repository at this point in the history
drawQuad ignores the swapY param if vertices are provided so swap Y
coords of vertices.
  • Loading branch information
flyinghead committed Oct 25, 2023
1 parent 4fafa91 commit 98a0f2b
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions core/rend/gles/gldraw.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -771,15 +771,15 @@ bool OpenGLRenderer::renderLastFrame()
if (gl.ofbo.shiftX != 0 || gl.ofbo.shiftY != 0)
{
static float sverts[20] = {
-1.f, 1.f, 1.f, 0.f, 1.f,
-1.f, -1.f, 1.f, 0.f, 0.f,
1.f, 1.f, 1.f, 1.f, 1.f,
-1.f, -1.f, 1.f, 0.f, 1.f,
-1.f, 1.f, 1.f, 0.f, 0.f,
1.f, -1.f, 1.f, 1.f, 1.f,
1.f, -1.f, 1.f, 1.f, 0.f,
};
sverts[0] = sverts[5] = -1.f + gl.ofbo.shiftX * 2.f / framebuffer->getWidth();
sverts[10] = sverts[15] = sverts[0] + 2;
sverts[1] = sverts[11] = 1.f - gl.ofbo.shiftY * 2.f / framebuffer->getHeight();
sverts[6] = sverts[16] = sverts[1] - 2;
sverts[1] = sverts[11] = -1.f - gl.ofbo.shiftY * 2.f / framebuffer->getHeight();
sverts[6] = sverts[16] = sverts[1] + 2;
vertices = sverts;
}
glcache.Disable(GL_BLEND);
Expand Down

0 comments on commit 98a0f2b

Please sign in to comment.