2023-11-15 19:20:52 -08:00
|
|
|
#pragma once
|
|
|
|
|
2023-11-22 14:39:27 -08:00
|
|
|
#include <mammoth/util/memory_region.h>
|
2023-11-15 19:20:52 -08:00
|
|
|
#include <yellowstone/yellowstone.yunq.h>
|
|
|
|
|
|
|
|
class Framebuffer {
|
|
|
|
public:
|
|
|
|
Framebuffer(const FramebufferInfo& info);
|
|
|
|
|
|
|
|
void DrawPixel(uint32_t row, uint32_t col, uint32_t pixel);
|
|
|
|
|
2023-11-21 19:14:02 -08:00
|
|
|
void DrawGlyph(uint8_t* glyph);
|
|
|
|
|
2023-11-21 19:32:31 -08:00
|
|
|
uint64_t width() { return fb_info_.width(); }
|
|
|
|
uint64_t height() { return fb_info_.height(); }
|
|
|
|
|
2023-11-15 19:20:52 -08:00
|
|
|
private:
|
|
|
|
// FIXME: Implement Yunq copy or move so we
|
|
|
|
// don't have to store a reference here.
|
|
|
|
const FramebufferInfo& fb_info_;
|
2023-11-19 20:48:23 -08:00
|
|
|
|
2023-11-22 14:59:41 -08:00
|
|
|
mmth::OwnedMemoryRegion fb_memory_;
|
2023-11-15 19:20:52 -08:00
|
|
|
uint32_t* fb_;
|
2023-11-21 19:14:02 -08:00
|
|
|
uint32_t cursor_pos_;
|
2023-11-15 19:20:52 -08:00
|
|
|
};
|