From 948720fba656b25b255297b2142dfaf5fc952e1f Mon Sep 17 00:00:00 2001 From: Kirill Petrashin Date: Mon, 29 Jun 2026 16:44:27 +0300 Subject: Add functions to output text --- framebuffer.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'framebuffer.h') diff --git a/framebuffer.h b/framebuffer.h index 7571294..6191f2c 100644 --- a/framebuffer.h +++ b/framebuffer.h @@ -65,6 +65,13 @@ void fb_put(Framebuffer fb, size_t row, size_t col, Pixel pixel); /* Draws a vertical line to fb on col x, from y1 to y2 */ void fb_vert_line(Framebuffer fb, size_t x, size_t y1, size_t y2, Pixel pixel); +/* Puts s onto fb in position (x, y) with given colour. s has to be null-terminated. + * x is of type long to handle text 'origin' being lefter than the left edge when x < 0 */ +void fb_text(Framebuffer fb, long x, size_t y, char *s, Colour fg, Colour bg); + +/* Same as above, but the background is 'transparent' */ +void fb_text_no_bg(Framebuffer fb, long x, size_t y, char *s, Colour fg); + /* Initializes the terminal and sets TERM_WIDTH and TERM_HEIGHT */ void term_init(void); -- cgit v1.2.3