Update set pixel to use integers instead of floats

This commit is contained in:
2023-12-18 14:15:18 +00:00
parent e6a3b73f99
commit 8a30e64696
2 changed files with 34 additions and 16 deletions

View File

@@ -13,19 +13,21 @@ typedef struct {
} colour_t;
typedef struct {
u64 width;
u64 height;
u32 width;
u32 height;
u32 half_width;
u32 half_height;
const char *title;
SDL_Window *window;
SDL_Surface *front_buffer;
SDL_Surface *back_buffer;
} window_t;
bool init_window(window_t *wnd, u64 width, u64 height, const char *title);
bool init_window(window_t *wnd, u32 width, u32 height, const char *title);
void close_window(window_t *wnd);
void clear_window(window_t *wnd, colour_t colour);
void set_pixel(window_t *wnd, f32 x, f32 y, colour_t colour);
void set_pixel(window_t *wnd, i32 x, i32 y, colour_t colour);
void swap_buffers(window_t *wnd);
#endif // !WINDOW_H