summaryrefslogtreecommitdiff
path: root/src/user/lib/include/draw.h
diff options
context:
space:
mode:
authordzwdz2023-02-23 20:07:59 +0100
committerdzwdz2023-02-23 20:07:59 +0100
commitfca80df9e638a7d68147d91cbffda95aed96ab5c (patch)
tree7f64c1bd425303e3a09baaf9975cfb476ddd527f /src/user/lib/include/draw.h
parent71ad3a8e7ace69f1c8dd732f5a223b93d8b5e946 (diff)
build: don't -Isrc/ in user code
Diffstat (limited to 'src/user/lib/include/draw.h')
-rw-r--r--src/user/lib/include/draw.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/user/lib/include/draw.h b/src/user/lib/include/draw.h
new file mode 100644
index 0000000..5e614be
--- /dev/null
+++ b/src/user/lib/include/draw.h
@@ -0,0 +1,24 @@
+#pragma once
+#include <camellia/types.h>
+#include <stddef.h>
+#include <stdint.h>
+
+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);