aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRay <raysan5@gmail.com>2018-12-19 17:06:23 +0100
committerRay <raysan5@gmail.com>2018-12-19 17:06:23 +0100
commitaf33e3848ece9b7faa6816efec98d22711f65e2e (patch)
treef2bf7e9e134df643ea51a00c23bd4c7114fa058f /src
parent49055a9b17f4b3818697995cb00a53d12916e60f (diff)
downloadraylib-af33e3848ece9b7faa6816efec98d22711f65e2e.tar.gz
raylib-af33e3848ece9b7faa6816efec98d22711f65e2e.zip
Improved BeginScissorMode()
Now rectangle coordinates refer to upper-left corner instead of bottom-left
Diffstat (limited to 'src')
-rw-r--r--src/rlgl.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/rlgl.h b/src/rlgl.h
index dfd2b370..6b17dcf5 100644
--- a/src/rlgl.h
+++ b/src/rlgl.h
@@ -3283,12 +3283,13 @@ void EndBlendMode(void)
}
// Begin scissor mode (define screen area for following drawing)
+// NOTE: Scissor rec refers to bottom-left corner, we change it to upper-left
void BeginScissorMode(int x, int y, int width, int height)
{
rlglDraw(); // Force drawing elements
glEnable(GL_SCISSOR_TEST);
- glScissor(x, y, width, height);
+ glScissor(x, GetScreenHeight() - (y + height), width, height);
rlClearScreenBuffers(); // Clear current scissor area
}