diff options
-rw-r--r-- | src/renderer.h | 17 |
1 files changed, 17 insertions, 0 deletions
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 @@ | |||
28 | #define FONT_SB 15 | 28 | #define FONT_SB 15 |
29 | #define FONT_OFFSET 192 | 29 | #define FONT_OFFSET 192 |
30 | 30 | ||
31 | // Draws a pixel to the given (x, y) position on the framebuffer. All drawing | ||
32 | // functions use paletted colors (clr: 0-15). | ||
31 | void draw_pixel(size_t x, size_t y, u8 clr); | 33 | void draw_pixel(size_t x, size_t y, u8 clr); |
34 | |||
35 | // Draw a line between (x0, y0) and (x1, y1). | ||
32 | void draw_line(size_t x0, size_t y0, size_t x1, size_t y1, u8 clr); | 36 | void draw_line(size_t x0, size_t y0, size_t x1, size_t y1, u8 clr); |
37 | |||
38 | // Draw a rectangle between (x0, y0) and (x1, y1) (x0 <= x1 && y0 <= y1). | ||
33 | void draw_rect(size_t x0, size_t y0, size_t x1, size_t y1, u8 clr); | 39 | void draw_rect(size_t x0, size_t y0, size_t x1, size_t y1, u8 clr); |
40 | |||
41 | // Draw a filled rectangle between (x0, y0) and (x1, y1) (x0 <= x1 and y0 <= y1). | ||
34 | void draw_filled_rect(size_t x0, size_t y0, size_t x1, size_t y1, u8 clr); | 42 | void draw_filled_rect(size_t x0, size_t y0, size_t x1, size_t y1, u8 clr); |
43 | |||
44 | // Draw a 8x8 tile starting at the (x, y) position. If the merge parameter is | ||
45 | // set, colors will be added together instead of replaced. This could lead to | ||
46 | // some merging issues if we are not careful with the chosen colors. | ||
35 | void draw_tile(size_t x, size_t y, Tile *tile, bool merge); | 47 | void draw_tile(size_t x, size_t y, Tile *tile, bool merge); |
48 | |||
49 | // Copies the content of dirty tiles from the backbuffer into the frontbuffer. | ||
50 | // To be called exactly once at the beginning of the VBlank. | ||
36 | void flip_buffer(void); | 51 | void flip_buffer(void); |
52 | |||
53 | // Initializes the renderer. | ||
37 | void renderer_init(void); | 54 | void renderer_init(void); |
38 | 55 | ||
39 | #endif // RENDERER__H | 56 | #endif // RENDERER__H |