Permalink
Browse files

GE Debugger: Fix preview when zooming.

Before, the coordinates were only right when scaled to fit.  When you
zoomed in and panned, it would show in the wrong place because it wasn't
accounting for the flipped backbuffer.
  • Loading branch information...
unknownbrackets committed Dec 23, 2017
1 parent 2031b2e commit a32ccd3eb8571d07550d30f5a3e129cd5ee1367b
Showing with 6 additions and 4 deletions.
  1. +6 −4 Windows/GEDebugger/VertexPreview.cpp
@@ -189,8 +189,9 @@ void CGEDebugger::UpdatePrimPreview(u32 op) {
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glBlendEquation(GL_FUNC_ADD);
glBindTexture(GL_TEXTURE_2D, 0);
glViewport((GLint)x, (GLint)y, (GLsizei)fw, (GLsizei)fh);
glScissor((GLint)x, (GLint)y, (GLsizei)fw, (GLsizei)fh);
// The surface is upside down, so vertical offsets are negated.
glViewport((GLint)x, (GLint)-(y + fh - primaryWindow->Height()), (GLsizei)fw, (GLsizei)fh);
glScissor((GLint)x, (GLint)-(y + fh - primaryWindow->Height()), (GLsizei)fw, (GLsizei)fh);
BindPreviewProgram(previewProgram);
// TODO: Probably there's a better way and place to do this.
@@ -277,8 +278,9 @@ void CGEDebugger::UpdatePrimPreview(u32 op) {
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glBlendEquation(GL_FUNC_ADD);
glBindTexture(GL_TEXTURE_2D, 0);
glViewport((GLint)x, (GLint)y, (GLsizei)fw, (GLsizei)fh);
glScissor((GLint)x, (GLint)y, (GLsizei)fw, (GLsizei)fh);
// The surface is upside down, so vertical offsets are flipped.
glViewport((GLint)x, (GLint)-(y + fh - secondWindow->Height()), (GLsizei)fw, (GLsizei)fh);
glScissor((GLint)x, (GLint)-(y + fh - secondWindow->Height()), (GLsizei)fw, (GLsizei)fh);
BindPreviewProgram(texPreviewProgram);
if (texPreviewVao == 0 && gl_extensions.ARB_vertex_array_object) {

0 comments on commit a32ccd3

Please sign in to comment.