From 1c2dc115b85a346ce1301af5098e92ea58d43dd4 Mon Sep 17 00:00:00 2001 From: Amaryllis Kulla Date: Sun, 30 Jan 2022 12:36:37 +0100 Subject: [PATCH] Graphics: Reset scissor box on screen resize Fixes Ancurio/mkxp#248. --- src/glstate.cpp | 2 +- src/graphics.cpp | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/glstate.cpp b/src/glstate.cpp index 0fbcdc6..a4b4d09 100644 --- a/src/glstate.cpp +++ b/src/glstate.cpp @@ -119,7 +119,7 @@ GLState::GLState(const Config &conf) blendMode.init(BlendNormal); blend.init(true); scissorTest.init(false); - scissorBox.init(IntRect(0, 0, 640, 480)); + scissorBox.init(IntRect()); program.init(0); if (conf.maxTextureSize > 0) diff --git a/src/graphics.cpp b/src/graphics.cpp index f13f950..1322d23 100644 --- a/src/graphics.cpp +++ b/src/graphics.cpp @@ -152,6 +152,7 @@ public: pp.startRender(); glState.viewport.set(IntRect(0, 0, w, h)); + glState.scissorBox.pushSet(IntRect(0, 0, w, h)); FBO::clear(); @@ -166,6 +167,8 @@ public: brightnessQuad.draw(); } + + glState.scissorBox.pop(); } void requestViewportRender(const Vec4 &c, const Vec4 &f, const Vec4 &t)