diff options
| author | gulrak <[email protected]> | 2023-11-06 19:03:12 +0100 |
|---|---|---|
| committer | GitHub <[email protected]> | 2023-11-06 19:03:12 +0100 |
| commit | 56b5a5c4f06f5b892c211e23dfb89c2e9a067068 (patch) | |
| tree | b55536fd8f09a595581ca070e2bb66debb6a6ae3 | |
| parent | 304bf2cd177b2a5f3906355c215481a589e63b74 (diff) | |
| download | raylib-56b5a5c4f06f5b892c211e23dfb89c2e9a067068.tar.gz raylib-56b5a5c4f06f5b892c211e23dfb89c2e9a067068.zip | |
BeginScissorMode checks for render texture to avoid using GetWindowScaleDPI (#3510)
| -rw-r--r-- | src/rcore.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/rcore.c b/src/rcore.c index 0e7927f0..adad7e43 100644 --- a/src/rcore.c +++ b/src/rcore.c @@ -1088,20 +1088,25 @@ void BeginScissorMode(int x, int y, int width, int height) rlEnableScissorTest(); + GLint id = 0; + glGetIntegerv(GL_FRAMEBUFFER_BINDING, &id); // Test for render texture #if defined(__APPLE__) - Vector2 scale = GetWindowScaleDPI(); - rlScissor((int)(x*scale.x), (int)(GetScreenHeight()*scale.y - (((y + height)*scale.y))), (int)(width*scale.x), (int)(height*scale.y)); + if(!id) + { + Vector2 scale = GetWindowScaleDPI(); + rlScissor((int)(x*scale.x), (int)(GetScreenHeight()*scale.y - (((y + height)*scale.y))), (int)(width*scale.x), (int)(height*scale.y)); + } #else - if ((CORE.Window.flags & FLAG_WINDOW_HIGHDPI) > 0) + if (!id && (CORE.Window.flags & FLAG_WINDOW_HIGHDPI) > 0) { Vector2 scale = GetWindowScaleDPI(); rlScissor((int)(x*scale.x), (int)(CORE.Window.currentFbo.height - (y + height)*scale.y), (int)(width*scale.x), (int)(height*scale.y)); } +#endif else { rlScissor(x, CORE.Window.currentFbo.height - (y + height), width, height); } -#endif } // End scissor mode |
