// Renderer abstraction (minimal scaffold)
#pragma once

#include <memory>
#include <SDL3/SDL.h>

namespace renderer {

class Renderer {
public:
    virtual ~Renderer() = default;

    // Create/destroy textures
    virtual SDL_Texture* createTextureFromSurface(SDL_Surface* surf) = 0;
    virtual void destroyTexture(SDL_Texture* tex) = 0;

    // Draw operations (minimal)
    // Copy a texture (integer rects)
    virtual void copy(SDL_Texture* tex, const SDL_Rect* src, const SDL_Rect* dst) = 0;
    // Copy a texture using floating-point rects (SDL_FRect)
    virtual void renderTexture(SDL_Texture* tex, const SDL_FRect* src, const SDL_FRect* dst) = 0;
    // Set alpha modulation on a texture
    virtual void setTextureAlphaMod(SDL_Texture* tex, Uint8 a) = 0;
    // Draw a line (floating-point coordinates)
    virtual void renderLine(float x1, float y1, float x2, float y2) = 0;
    // Set draw color and draw filled/floating rects
    virtual void clear(const SDL_Color& color) = 0;
    virtual void setDrawColor(const SDL_Color& color) = 0;
    virtual void fillRectF(const SDL_FRect* rect) = 0;
    virtual void drawRectF(const SDL_FRect* rect) = 0;
    virtual void present() = 0;
};

// Factory helper implemented by SDL-specific backend
std::unique_ptr<Renderer> MakeSDLRenderer(SDL_Renderer* rdr);

} // namespace renderer

