summaryrefslogtreecommitdiffhomepage
path: root/src/core.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/core.c')
-rw-r--r--src/core.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/core.c b/src/core.c
index 4352a321..bc633e8b 100644
--- a/src/core.c
+++ b/src/core.c
@@ -1392,6 +1392,23 @@ void EndTextureMode(void)
currentHeight = GetScreenHeight();
}
+// 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
+
+ rlEnableScissorTest();
+ rlScissor(x, GetScreenHeight() - (y + height), width, height);
+}
+
+// End scissor mode
+void EndScissorMode(void)
+{
+ rlglDraw(); // Force drawing elements
+ rlDisableScissorTest();
+}
+
// Returns a ray trace from mouse position
Ray GetMouseRay(Vector2 mousePosition, Camera camera)
{