From 642b5fb0007b64c77d186fcb018d571152ee1d47 Mon Sep 17 00:00:00 2001 From: dzwdz Date: Mon, 14 Aug 2023 18:51:07 +0200 Subject: reorganization: first steps --- src/libc/include/draw.h | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 src/libc/include/draw.h (limited to 'src/libc/include/draw.h') diff --git a/src/libc/include/draw.h b/src/libc/include/draw.h new file mode 100644 index 0000000..5e614be --- /dev/null +++ b/src/libc/include/draw.h @@ -0,0 +1,24 @@ +#pragma once +#include +#include +#include + +struct framebuf { + size_t len, width, height, pitch; + uint8_t bpp; + char *b; + + hid_t fd; +}; + +struct rect { uint32_t x1, y1, x2, y2; }; +void dirty_reset(struct rect *d); +void dirty_mark(struct rect *d, uint32_t x, uint32_t y); +void dirty_flush(struct rect *d, struct framebuf *fb); + +int fb_setup(struct framebuf *fb, const char *base); +int fb_anon(struct framebuf *fb, size_t w, size_t h); +uint32_t *fb_pixel(struct framebuf *fb, uint32_t x, uint32_t y); +void fb_cpy( + struct framebuf *dest, const struct framebuf *src, + size_t xd, size_t yd, size_t xs, size_t ys, size_t w, size_t h); -- cgit v1.2.3