fixed game renderer

This commit is contained in:
2025-12-25 14:39:56 +01:00
parent 6ef93e4c9c
commit 17cb64c9d4

View File

@ -1,7 +1,8 @@
// Renderer abstraction (minimal scaffold)
#pragma once
#include <SDL3/SDL.h>
#include <memory>
#include <SDL3/SDL.h>
namespace renderer {
@ -9,12 +10,18 @@ class Renderer {
public:
virtual ~Renderer() = default;
// Wrap common operations used by renderers
// Create/destroy textures
virtual SDL_Texture* createTextureFromSurface(SDL_Surface* surf) = 0;
virtual void destroyTexture(SDL_Texture* tex) = 0;
// Draw operations (minimal)
virtual void copy(SDL_Texture* tex, const SDL_Rect* src, const SDL_Rect* dst) = 0;
virtual void clear(const SDL_Color& color) = 0;
virtual void present() = 0;
};
// Factory helper implemented by SDL-specific backend
std::unique_ptr<Renderer> MakeSDLRenderer(SDL_Renderer* rdr);
} // namespace renderer