aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSam Anthony <sam@samanthony.xyz>2025-04-30 11:30:48 -0400
committerSam Anthony <sam@samanthony.xyz>2025-04-30 11:30:48 -0400
commit550dee49514fe3528c43541f062c1ae5590313ae (patch)
tree5378c2940fa8352d5e365ec5309a8de8635ed9b4
parenteb38a10f13e0c778afe72171a6792e615d01087e (diff)
downloadvolute-550dee49514fe3528c43541f062c1ae5590313ae.zip
clear canvas
-rw-r--r--renderer.c10
-rw-r--r--renderer.h1
2 files changed, 11 insertions, 0 deletions
diff --git a/renderer.c b/renderer.c
index 4e4444f..4d6b378 100644
--- a/renderer.c
+++ b/renderer.c
@@ -481,6 +481,16 @@ r_canvas_draw_circle(int id, int x, int y, int r, mu_Color color) {
return 0;
}
+void
+r_clear_canvas(int id) {
+ Canvas canvas;
+
+ expect(id >= 0 && id < canvas_list.idx);
+
+ canvas = canvas_list.items[id];
+ clear_surface(canvas.fg);
+}
+
/* Render a canvas to its underlying icon texture. Returns the id of the icon, or -1 on error. */
int
r_render_canvas(int id) {
diff --git a/renderer.h b/renderer.h
index eadfef3..84651f9 100644
--- a/renderer.h
+++ b/renderer.h
@@ -9,4 +9,5 @@ void r_get_icon_size(int id, int *w, int *h);
int r_add_canvas(const char *bg_img_path);
void r_remove_canvas(int id);
int r_canvas_draw_circle(int id, int x, int y, int r, mu_Color color);
+void r_clear_canvas(int id);
int r_render_canvas(int id);