Files
spacetris/src/graphics/renderers/RenderPrimitives.h
2025-12-19 18:22:26 +01:00

17 lines
392 B
C++

#pragma once
#include <SDL3/SDL.h>
namespace RenderPrimitives {
inline void fillRect(SDL_Renderer* renderer, float x, float y, float w, float h, SDL_Color color) {
if (!renderer) {
return;
}
SDL_SetRenderDrawColor(renderer, color.r, color.g, color.b, color.a);
SDL_FRect rect{x, y, w, h};
SDL_RenderFillRect(renderer, &rect);
}
} // namespace RenderPrimitives