Mercurial > public > algo-animator
diff utils.c @ 6:40a8bdbe2005
Refactor to array of structures
author | Dennis C. M. <dennis@denniscm.com> |
---|---|
date | Tue, 13 Jun 2023 18:37:23 +0100 |
parents | 6be2faa7ed6e |
children | f159eec07daf |
line wrap: on
line diff
--- a/utils.c Tue Jun 13 17:23:52 2023 +0100 +++ b/utils.c Tue Jun 13 18:37:23 2023 +0100 @@ -13,3 +13,11 @@ int random_int(int min, int max) { return rand() % ((max - min) + 1) + min; } + + +void draw_rectangle(int x_position, int rect_height, int rect_width, int window_height) { + glVertex2f(x_position, window_height - 100); + glVertex2f(x_position + rect_width, window_height - 100); + glVertex2f(x_position + rect_width, rect_height); + glVertex2d(x_position, rect_height); +}