From dc718d39e520da0b9e4c49d45da4f43700f0f895 Mon Sep 17 00:00:00 2001 From: Kirill Petrashin Date: Tue, 23 Jun 2026 22:02:59 +0300 Subject: Add a function to draw a vertical line --- framebuffer.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'framebuffer.c') diff --git a/framebuffer.c b/framebuffer.c index b4c2f6e..01d169c 100644 --- a/framebuffer.c +++ b/framebuffer.c @@ -1,3 +1,4 @@ +#include #include #include #include @@ -71,6 +72,14 @@ void fb_put(Framebuffer fb, size_t row, size_t col, Pixel pixel) { fb.fb[row][col] = pixel; } +void fb_vert_line(Framebuffer fb, size_t x, size_t y1, size_t y2, Pixel pixel) { + assert(y2 >= y1); + + for (size_t y = y1; y <= y2; y++) { + fb.fb[y][x] = pixel; + } +} + void term_init(void) { tcgetattr(0, &initial_terminal_state); -- cgit v1.2.3