Luna/kernel/include/render/Framebuffer.h
2022-09-10 18:42:40 +02:00

30 lines
726 B
C++

#pragma once
#include "render/Color.h"
class Framebuffer
{
public:
void init(void* fb_address, int fb_type, int fb_scanline, int fb_width, int fb_height);
void set_pixel(uint32_t x, uint32_t y, Color color);
Color get_pixel(uint32_t x, uint32_t y);
void paint_rect(uint32_t x, uint32_t y, uint32_t w, uint32_t h, Color color);
void paint_rect(uint32_t x, uint32_t y, uint32_t w, uint32_t h, Color* colors);
void clear(Color color);
int width()
{
return m_fb_width;
}
int height()
{
return m_fb_height;
}
private:
void* m_fb_address;
int m_fb_type;
int m_fb_scanline;
int m_fb_width;
int m_fb_height;
};
extern Framebuffer framebuffer0;