Files
ui-library-playground/Core/Src/graphics/graphics.c
Dylan Smith 6cdbe8cb11 WIP
2026-01-12 16:26:40 -05:00

27 lines
692 B
C

#include "graphics.h"
void DisplayTest(pixel_t color)
{
for (uint16_t h = 0; h < DISPLAY_HEIGHT; h++)
{
for (uint16_t w = 0; w < DISPLAY_WIDTH; w++)
{
framebuffer[(h * DISPLAY_WIDTH) + w] = color;
}
}
}
void DrawBox(uint32_t topleft_x_loc, uint32_t topleft_y_loc, uint32_t width, uint32_t height, pixel_t color)
{
for (uint32_t y = topleft_y_loc; y < (topleft_y_loc + height); y++)
{
for (uint32_t x = topleft_x_loc; x < (topleft_x_loc + width); x++)
{
if (x < DISPLAY_WIDTH && y < DISPLAY_HEIGHT)
{
framebuffer[(y * DISPLAY_WIDTH) + x] = color;
}
}
}
}