diff --git a/src/modules/graphics/opengl/Graphics.cpp b/src/modules/graphics/opengl/Graphics.cpp index 88bc855d5..ed7f0c40a 100644 --- a/src/modules/graphics/opengl/Graphics.cpp +++ b/src/modules/graphics/opengl/Graphics.cpp @@ -789,7 +789,7 @@ void Graphics::setRenderTargetsInternal(const RenderTargets &rts, int pixelw, in // Re-apply the scissor if it was active, since the rectangle passed to // glScissor is affected by the viewport dimensions. if (state.scissor) - setScissor(state.scissorRect); + setScissor(state.scissorRect, !iswindow); // Make sure the correct sRGB setting is used when drawing to the textures. if (GLAD_VERSION_1_0 || GLAD_EXT_sRGB_write_control) @@ -1324,7 +1324,7 @@ int Graphics::getBackbufferMSAA() const return internalBackbuffer.get() ? internalBackbuffer->getMSAA() : 0; } -void Graphics::setScissor(const Rect &rect) +void Graphics::setScissor(const Rect &rect, bool rtActive) { flushBatchedDraws(); @@ -1342,12 +1342,17 @@ void Graphics::setScissor(const Rect &rect) glrect.h = (int) (rect.h * dpiscale); // OpenGL's reversed y-coordinate is compensated for in OpenGL::setScissor. - gl.setScissor(glrect, isRenderTargetActive()); + gl.setScissor(glrect, rtActive); state.scissor = true; state.scissorRect = rect; } +void Graphics::setScissor(const Rect &rect) +{ + setScissor(rect, isRenderTargetActive()); +} + void Graphics::setScissor() { if (states.back().scissor) diff --git a/src/modules/graphics/opengl/Graphics.h b/src/modules/graphics/opengl/Graphics.h index 31dd4661e..e3e41fc5c 100644 --- a/src/modules/graphics/opengl/Graphics.h +++ b/src/modules/graphics/opengl/Graphics.h @@ -155,6 +155,8 @@ private: void setDebug(bool enable); + void setScissor(const Rect &rect, bool rtActive); + uint32 computePixelFormatUsage(PixelFormat format, bool readable); std::unordered_map framebufferObjects;