Files
ui-library-playground/Core/Src/graphics/graphics.c
2026-01-15 16:49:53 -05:00

28 lines
723 B
C

#include "graphics.h"
#include "display.h"
void DisplayTest(pixel_t color)
{
for (uint16_t h = 0; h < DISPLAY_HEIGHT; h++)
{
for (uint16_t w = 0; w < DISPLAY_WIDTH; w++)
{
next_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)
{
next_framebuffer[(y * DISPLAY_WIDTH) + x] = color;
}
}
}
}