Skip to content

Commit 8739c28

Browse files
committed
REVIEWED: Scissor mode to support RenderTexture #3510
1 parent 56b5a5c commit 8739c28

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/rcore.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1088,22 +1088,20 @@ void BeginScissorMode(int x, int y, int width, int height)
10881088

10891089
rlEnableScissorTest();
10901090

1091-
GLint id = 0;
1092-
glGetIntegerv(GL_FRAMEBUFFER_BINDING, &id); // Test for render texture
10931091
#if defined(__APPLE__)
1094-
if(!id)
1092+
if (CORE.Window.usingFbo)
10951093
{
10961094
Vector2 scale = GetWindowScaleDPI();
10971095
rlScissor((int)(x*scale.x), (int)(GetScreenHeight()*scale.y - (((y + height)*scale.y))), (int)(width*scale.x), (int)(height*scale.y));
10981096
}
10991097
#else
1100-
if (!id && (CORE.Window.flags & FLAG_WINDOW_HIGHDPI) > 0)
1098+
if (CORE.Window.usingFbo && ((CORE.Window.flags & FLAG_WINDOW_HIGHDPI) > 0))
11011099
{
11021100
Vector2 scale = GetWindowScaleDPI();
11031101
rlScissor((int)(x*scale.x), (int)(CORE.Window.currentFbo.height - (y + height)*scale.y), (int)(width*scale.x), (int)(height*scale.y));
11041102
}
11051103
#endif
1106-
else
1104+
else
11071105
{
11081106
rlScissor(x, CORE.Window.currentFbo.height - (y + height), width, height);
11091107
}

0 commit comments

Comments
 (0)