Expose scissor functionality
This commit is contained in:
parent
8e86f3586d
commit
addbd88833
3 changed files with 35 additions and 37 deletions
17
src/core.c
17
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)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue