diff options
| author | Ray <[email protected]> | 2023-11-06 19:09:12 +0100 |
|---|---|---|
| committer | Ray <[email protected]> | 2023-11-06 19:09:12 +0100 |
| commit | 8739c2894929ddbd66f68ba2416942bd727d5446 (patch) | |
| tree | 75f5345df291828fc295b3fc7ed33b6b7fecb178 /src | |
| parent | 56b5a5c4f06f5b892c211e23dfb89c2e9a067068 (diff) | |
| download | raylib-8739c2894929ddbd66f68ba2416942bd727d5446.tar.gz raylib-8739c2894929ddbd66f68ba2416942bd727d5446.zip | |
REVIEWED: Scissor mode to support RenderTexture #3510
Diffstat (limited to 'src')
| -rw-r--r-- | src/rcore.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/rcore.c b/src/rcore.c index adad7e43..4c7eded2 100644 --- a/src/rcore.c +++ b/src/rcore.c @@ -1088,22 +1088,20 @@ 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__) - if(!id) + if (CORE.Window.usingFbo) { 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 (!id && (CORE.Window.flags & FLAG_WINDOW_HIGHDPI) > 0) + if (CORE.Window.usingFbo && ((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 + else { rlScissor(x, CORE.Window.currentFbo.height - (y + height), width, height); } |
