REVIEWED: Scissor mode to support RenderTexture #3510
This commit is contained in:
parent
56b5a5c4f0
commit
8739c28949
1 changed files with 3 additions and 5 deletions
|
@ -1088,16 +1088,14 @@ 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));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue