Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 19 additions & 3 deletions include/kernel/framebuffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@

namespace framebuffer
{
enum class BufferTarget
{
Draw,
Display
};

struct FrameBufferInfo
{
uint32_t width = 0;
Expand All @@ -22,9 +28,15 @@ const FrameBufferInfo &info();

uint32_t framebuffer_physical_address();
uint32_t framebuffer_size();
bool double_buffering_enabled();

uint32_t pack_color(uint8_t r, uint8_t g, uint8_t b);
void fill_rect(uint32_t x, uint32_t y, uint32_t width, uint32_t height, uint32_t color);
void fill_rect(uint32_t x,
uint32_t y,
uint32_t width,
uint32_t height,
uint32_t color,
BufferTarget target = BufferTarget::Draw);
void draw_mono_bitmap(uint32_t x,
uint32_t y,
uint32_t width,
Expand All @@ -33,6 +45,10 @@ void draw_mono_bitmap(uint32_t x,
uint32_t stride,
uint32_t fg_color,
uint32_t bg_color,
bool transparent_bg);
uint32_t peek_pixel(uint32_t x, uint32_t y);
bool transparent_bg,
BufferTarget target = BufferTarget::Draw);
uint32_t peek_pixel(uint32_t x,
uint32_t y,
BufferTarget target = BufferTarget::Display);
void present();
}
2 changes: 2 additions & 0 deletions src/kernel/debug.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -450,6 +450,8 @@ void render_gui_panic_screen(const char *message,
helper_color,
"System halted. Check the serial console for additional information.",
LINE_SPACING);

framebuffer::present();
}
} // namespace

Expand Down
Loading