BeginScissorMode checks for render texture to avoid using GetWindowScaleDPI (#3510)
This commit is contained in:
parent
304bf2cd17
commit
56b5a5c4f0
1 changed files with 9 additions and 4 deletions
|
@ -1088,20 +1088,25 @@ void BeginScissorMode(int x, int y, int width, int height)
|
||||||
|
|
||||||
rlEnableScissorTest();
|
rlEnableScissorTest();
|
||||||
|
|
||||||
|
GLint id = 0;
|
||||||
|
glGetIntegerv(GL_FRAMEBUFFER_BINDING, &id); // Test for render texture
|
||||||
#if defined(__APPLE__)
|
#if defined(__APPLE__)
|
||||||
|
if(!id)
|
||||||
|
{
|
||||||
Vector2 scale = GetWindowScaleDPI();
|
Vector2 scale = GetWindowScaleDPI();
|
||||||
rlScissor((int)(x*scale.x), (int)(GetScreenHeight()*scale.y - (((y + height)*scale.y))), (int)(width*scale.x), (int)(height*scale.y));
|
rlScissor((int)(x*scale.x), (int)(GetScreenHeight()*scale.y - (((y + height)*scale.y))), (int)(width*scale.x), (int)(height*scale.y));
|
||||||
|
}
|
||||||
#else
|
#else
|
||||||
if ((CORE.Window.flags & FLAG_WINDOW_HIGHDPI) > 0)
|
if (!id && (CORE.Window.flags & FLAG_WINDOW_HIGHDPI) > 0)
|
||||||
{
|
{
|
||||||
Vector2 scale = GetWindowScaleDPI();
|
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));
|
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);
|
rlScissor(x, CORE.Window.currentFbo.height - (y + height), width, height);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// End scissor mode
|
// End scissor mode
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue