Luna/kernel/src/sys/paint.cpp
2022-10-01 13:09:43 +02:00

26 lines
543 B
C++

#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));
context->rax = 0;
}