clip()
RenderingDescription
Limits the rendering to a rectangular area. Only pixels inside the clip region will be drawn.
Syntax
void clip(float x, float y, float w, float h)
Parameters
| Name | Type | Description |
|---|---|---|
| x | float | x-coordinate |
| y | float | y-coordinate |
| w | float | width of clip region |
| h | float | height of clip region |
Returns
voidRelated
Under the Hood
From Processing.h:
void clip(float x, float y, float w, float h);
Under the Hood
From Processing.cpp:
void PApplet::clip(float x, float y, float w, float h) {
// Scissor coordinates are in GL space (Y=0 at bottom), so flip Y
glEnable(GL_SCISSOR_TEST);
glScissor((int)x, winHeight - (int)(y + h), (int)w, (int)h);
}