summaryrefslogtreecommitdiff
path: root/include/mercury/kernel/framebuffer.hpp
diff options
context:
space:
mode:
authorBenji Dial <benji@benjidial.net>2024-01-08 22:28:41 -0500
committerBenji Dial <benji@benjidial.net>2024-01-08 22:28:41 -0500
commitc2f48fb5df0981df1df23de2b277274f9fe75080 (patch)
tree5202557438bbe3bdc7d10c7769731ab3594185f9 /include/mercury/kernel/framebuffer.hpp
downloadhilbert-os-c2f48fb5df0981df1df23de2b277274f9fe75080.tar.gz
first commit
Diffstat (limited to 'include/mercury/kernel/framebuffer.hpp')
-rw-r--r--include/mercury/kernel/framebuffer.hpp27
1 files changed, 27 insertions, 0 deletions
diff --git a/include/mercury/kernel/framebuffer.hpp b/include/mercury/kernel/framebuffer.hpp
new file mode 100644
index 0000000..5c6ca23
--- /dev/null
+++ b/include/mercury/kernel/framebuffer.hpp
@@ -0,0 +1,27 @@
+#ifndef MERCURY_KERNEL_FRAMEBUFFER_HPP
+#define MERCURY_KERNEL_FRAMEBUFFER_HPP
+
+#include <cstdint>
+
+namespace mercury::kernel::framebuffer {
+
+ extern int width;
+ extern int height;
+
+ void init_framebuffer(uint64_t vaddr, uint64_t width, uint64_t height, uint64_t pitch);
+
+ typedef uint32_t color;
+ color encode_color(uint8_t r, uint8_t g, uint8_t b);
+
+ void set_pixel(int x, int y, color c);
+
+ //[from_start_x, from_end_x) x [from_start_y, from_end_y) -> [to_start_x, ...) x [to_start_y, ...)
+ //we assume from_start_x < from_end_x and from_start_y < from_end_y
+ void move_region(int from_start_x, int from_start_y, int from_end_x, int from_end_y, int to_start_x, int to_start_y);
+
+ //[start_x, end_x) x [start_y, end_y)
+ void fill_region(int start_x, int start_y, int end_x, int end_y, color c);
+
+}
+
+#endif