#include #include #include #include #include #include #include namespace testbed { void rendering_system(entt::registry ®istry, const context &ctx) { SDL_SetRenderLogicalPresentation(ctx, ctx.logical_width(), ctx.logical_height(), SDL_LOGICAL_PRESENTATION_LETTERBOX); SDL_SetRenderDrawColor(ctx, 0u, 0u, 0u, SDL_ALPHA_OPAQUE); SDL_RenderClear(ctx); for(auto [entt, pos, rect]: registry.view().each()) { SDL_FRect elem{rect.x + pos.x, rect.y + pos.y, rect.w, rect.h}; SDL_SetRenderDrawColor(ctx, 255u, 255u, 255u, SDL_ALPHA_OPAQUE); SDL_RenderFillRect(ctx, &elem); } SDL_SetRenderLogicalPresentation(ctx, 0, 0, SDL_LOGICAL_PRESENTATION_DISABLED); } } // namespace testbed