diff options
| author | iamcheeseman <[email protected]> | 2026-05-21 20:03:50 -0400 |
|---|---|---|
| committer | iamcheeseman <[email protected]> | 2026-05-21 20:04:19 -0400 |
| commit | a573068a4faad9aa1a0aa9fad92162ce0f2ad483 (patch) | |
| tree | 0a1d78af447476f61c780f03244fb9ece7f01b99 /teensy/teensy.h | |
| parent | b98d216add98579c3a91b74fa5233f8534200297 (diff) | |
Allow the clipping of rendering
Diffstat (limited to 'teensy/teensy.h')
| -rw-r--r-- | teensy/teensy.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/teensy/teensy.h b/teensy/teensy.h index 1a738d7..300939c 100644 --- a/teensy/teensy.h +++ b/teensy/teensy.h @@ -23,6 +23,8 @@ #define ty_max(a, b) ((a) > (b) ? (a) : (b)) #define ty_min(a, b) ((a) < (b) ? (a) : (b)) +#define TY_CLIP_NONE ((ty_Recti){0}) + #define TY_COLOR_BLACK ty_color(0, 0, 0 ) #define TY_COLOR_RED ty_color(255, 0, 0 ) #define TY_COLOR_GREEN ty_color(0, 255, 0 ) @@ -178,6 +180,9 @@ int ty_font_height(const ty_Font *font); // Sets the image that the renderer draws to. Pass NULL to restore the screen. void ty_draw_set_target(const ty_Image *img); +// Prevents anything from being drawn outside of the passed rect. Pass +// TY_CLIP_NONE to reset the clipspace. +void ty_draw_set_clip(ty_Recti clip); // Sets the entire render target to one color. void ty_draw_clear(ty_Color col); // Draws an image at the specified position. The color #FF00FF will be ignored |
