From a61863764da3747a68f34a86e2b5ffa20158feef Mon Sep 17 00:00:00 2001 From: JM <crewgan@pop-os.localdomain> Date: Mon, 2 May 2022 10:29:11 +0200 Subject: [PATCH] add gfx methods --- utils/gfx/gfx.c | 9 +++++++++ utils/gfx/gfx.h | 8 ++++++++ 2 files changed, 17 insertions(+) diff --git a/utils/gfx/gfx.c b/utils/gfx/gfx.c index cd6662f..a77eb85 100644 --- a/utils/gfx/gfx.c +++ b/utils/gfx/gfx.c @@ -102,4 +102,13 @@ SDL_Keycode gfx_keypressed() return event.key.keysym.sym; } return 0; +} + + +void gfx_draw_line(struct gfx_context_t *ctxt, coordinates_t p0, coordinates_t p1, uint32_t color){ + +} + +void gfx_draw_circle(struct gfx_context_t *ctxt, coordinates_t c, uint32_t r, uint32_t color){ + } \ No newline at end of file diff --git a/utils/gfx/gfx.h b/utils/gfx/gfx.h index 4d9d13a..37423cc 100644 --- a/utils/gfx/gfx.h +++ b/utils/gfx/gfx.h @@ -29,6 +29,12 @@ struct gfx_context_t uint32_t height; }; +typedef struct +{ + uint32_t row; + uint32_t column; +} coordinates_t; + extern void gfx_putpixel( struct gfx_context_t *ctxt, uint32_t column, uint32_t row, uint32_t color); extern void gfx_clear(struct gfx_context_t *ctxt, uint32_t color); @@ -36,5 +42,7 @@ extern struct gfx_context_t *gfx_create(char *text, uint32_t width, uint32_t hei extern void gfx_destroy(struct gfx_context_t *ctxt); extern void gfx_present(struct gfx_context_t *ctxt); extern SDL_Keycode gfx_keypressed(); +void gfx_draw_line(struct gfx_context_t *ctxt, coordinates_t p0, coordinates_t p1, uint32_t color); +void gfx_draw_circle(struct gfx_context_t *ctxt, coordinates_t c, uint32_t r, uint32_t color); #endif -- GitLab