framebuffer.h (647B)
1 #ifndef FRAMEBUFFER_H 2 #define FRAMEBUFFER_H 3 4 #include <stdint.h> 5 #include <stddef.h> 6 #include <limine.h> 7 8 #define FB_CHAR_WIDTH 8 9 #define FB_CHAR_HEIGHT 16 10 11 typedef struct { 12 uint32_t fg_color; 13 uint32_t bg_color; 14 uint32_t cursor_x; 15 uint32_t cursor_y; 16 uint32_t cols; 17 uint32_t rows; 18 struct limine_framebuffer *fb; 19 } fb_console_t; 20 21 void fb_init(void); 22 void fb_putchar(char c); 23 void fb_puts(const char *str); 24 void fb_clear(void); 25 void fb_set_color(uint32_t fg, uint32_t bg); 26 void fb_printf(const char *fmt, ...); 27 void fb_draw_rect(uint32_t x, uint32_t y, uint32_t w, uint32_t h, uint32_t color); 28 29 #endif /* FRAMEBUFFER_H */