karlos/include/framebuffer.h

29 lines
559 B
C

#ifndef KARLOS_FRAMEBUFFER_H
#define KARLOS_FRAMEBUFFER_H
#include "stdint.h"
struct rect {
unsigned x1, y1, x2, y2;
};
#define RECT(x1, y1, x2, y2) (struct rect){ x1, y1, x2, y2 }
#define RECT_XYWH(x, y, w, h) (struct rect){ x, y, x + w, y + h }
struct color {
uint8_t r;
uint8_t g;
uint8_t b;
};
#define COLOR(r, g, b) (struct color){ r, g, b }
void fb_init();
void fb_set_px(unsigned int x, unsigned int y, struct color color);
void fb_refresh();
void fb_damage(struct rect dmg);
unsigned int fb_width();
unsigned int fb_height();
#endif