Luna/kernel/src/sys/paint.cpp

26 lines
543 B
C++
Raw Normal View History

2022-09-29 18:06:18 +00:00
#include "bootboot.h"
#include "interrupts/Context.h"
#include "render/Framebuffer.h"
#include <stdint.h>
extern BOOTBOOT bootboot;
void sys_paint(Context* context, uint64_t x, uint64_t y, uint64_t w, uint64_t h, uint64_t c)
{
if ((x + w) > bootboot.fb_width)
{
context->rax = -1;
return;
}
if ((y + h) > bootboot.fb_height)
{
context->rax = -1;
return;
}
uint32_t color = (uint32_t)c;
framebuffer0.paint_rect(x, y, w, h, Color::from_integer(color));
2022-09-29 18:06:18 +00:00
context->rax = 0;
}