From 3a62d618693d34fc807824698e8a64ba9a8d804c Mon Sep 17 00:00:00 2001 From: Bad Diode Date: Sun, 6 Jun 2021 11:39:58 +0200 Subject: Add extra comments for exported renderer functions --- src/renderer.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'src') diff --git a/src/renderer.h b/src/renderer.h index e0aae31..fd48bcf 100644 --- a/src/renderer.h +++ b/src/renderer.h @@ -28,12 +28,29 @@ #define FONT_SB 15 #define FONT_OFFSET 192 +// Draws a pixel to the given (x, y) position on the framebuffer. All drawing +// functions use paletted colors (clr: 0-15). void draw_pixel(size_t x, size_t y, u8 clr); + +// Draw a line between (x0, y0) and (x1, y1). void draw_line(size_t x0, size_t y0, size_t x1, size_t y1, u8 clr); + +// Draw a rectangle between (x0, y0) and (x1, y1) (x0 <= x1 && y0 <= y1). void draw_rect(size_t x0, size_t y0, size_t x1, size_t y1, u8 clr); + +// Draw a filled rectangle between (x0, y0) and (x1, y1) (x0 <= x1 and y0 <= y1). void draw_filled_rect(size_t x0, size_t y0, size_t x1, size_t y1, u8 clr); + +// Draw a 8x8 tile starting at the (x, y) position. If the merge parameter is +// set, colors will be added together instead of replaced. This could lead to +// some merging issues if we are not careful with the chosen colors. void draw_tile(size_t x, size_t y, Tile *tile, bool merge); + +// Copies the content of dirty tiles from the backbuffer into the frontbuffer. +// To be called exactly once at the beginning of the VBlank. void flip_buffer(void); + +// Initializes the renderer. void renderer_init(void); #endif // RENDERER__H -- cgit v1.2.1