diff options
| author | Ray <[email protected]> | 2018-12-15 23:30:55 +0100 |
|---|---|---|
| committer | Ray <[email protected]> | 2018-12-15 23:30:55 +0100 |
| commit | 4008a075a857f7674fe82331dae2636fc593dade (patch) | |
| tree | c0a093b77d4e3470e031ab7cd065491bfabff6d8 /src/rlgl.h | |
| parent | cbbd67ab5a8735c9daee1590729c1fdc58594652 (diff) | |
| download | raylib-4008a075a857f7674fe82331dae2636fc593dade.tar.gz raylib-4008a075a857f7674fe82331dae2636fc593dade.zip | |
Added scissor functionality
To draw only in defined area of the screen
ADDED: BeginScissorMode(), EndScissorMode()
Diffstat (limited to 'src/rlgl.h')
| -rw-r--r-- | src/rlgl.h | 19 |
1 files changed, 19 insertions, 0 deletions
@@ -3313,6 +3313,25 @@ void EndBlendMode(void) BeginBlendMode(BLEND_ALPHA); } +// Begin scissor mode (define screen area for following drawing) +void BeginScissorMode(int x, int y, int width, int height) +{ + rlglDraw(); // Force drawing elements + + glEnable(GL_SCISSOR_TEST); + glScissor(x, y, width, height); + + rlClearScreenBuffers(); // Clear current scissor area +} + +// End scissor mode +void EndScissorMode(void) +{ + rlglDraw(); // Force drawing elements + + glDisable(GL_SCISSOR_TEST); +} + #if defined(SUPPORT_VR_SIMULATOR) // Get VR device information for some standard devices VrDeviceInfo GetVrDeviceInfo(int vrDeviceType) |
