diff options
author | quou <quou@disroot.org> | 2024-10-01 19:09:01 +1000 |
---|---|---|
committer | quou <quou@disroot.org> | 2024-10-01 19:09:01 +1000 |
commit | 48721756517c3bcac5522740fb76d405a9b31f09 (patch) | |
tree | d641572d1eeb36c13b4882eada77c8b2d469df2f | |
parent | 1c5b6a90d0515d7070a628c1c2d71649b9da2ec1 (diff) |
ren_clip
-rw-r--r-- | render.c | 7 | ||||
-rw-r--r-- | render.h | 1 |
2 files changed, 8 insertions, 0 deletions
@@ -31,6 +31,13 @@ void ren_end(Renderer* r) { (void)r; } +void ren_clip(Renderer* r, const Rect* re) { + r->clip[0] = re->x; + r->clip[1] = re->y; + r->clip[2] = re->x + re->w; + r->clip[3] = re->y + re->h; +} + void ren_clear(Renderer* r) { int i, j; for (j = r->clip[1]; j < r->clip[3]; j++) @@ -15,6 +15,7 @@ typedef struct Renderer { void ren_begin(Renderer* r, unsigned* t, int w, int h); void ren_end(Renderer* r); +void ren_clip(Renderer* r, const struct Rect* re); void ren_clear(Renderer* r); void ren_char(Renderer* r, int x, int y, char ch); void ren_text(Renderer* r, int x, int y, const char* t); |