aboutsummaryrefslogtreecommitdiffstats
path: root/renderer.c
diff options
context:
space:
mode:
Diffstat (limited to 'renderer.c')
-rw-r--r--renderer.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/renderer.c b/renderer.c
index 900a6c9..6c5782f 100644
--- a/renderer.c
+++ b/renderer.c
@@ -337,3 +337,13 @@ r_remove_icon(int id) {
icon_list.idx--;
}
+
+void
+r_get_icon_size(int id, int *w, int *h) {
+ expect(id >= 0 && id < icon_list.idx);
+
+ *w = *h = 0;
+ if (SDL_QueryTexture(icon_list.items[id], NULL, NULL, w, h) != 0) {
+ fprintf(stderr, "%s\n", SDL_GetError());
+ }
+}