#pragma once

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

/**
 * @brief Abstract interface for rendering operations
 * 
 * Provides a common interface for different rendering implementations,
 * enabling dependency injection and easier testing.
 */
class IRenderer {
public:
    virtual ~IRenderer() = default;
    
    /**
     * @brief Clear the render target with specified color (interface method)
     * @param r Red component (0-255)
     * @param g Green component (0-255)
     * @param b Blue component (0-255)
     * @param a Alpha component (0-255)
     */
    virtual void clearScreen(uint8_t r, uint8_t g, uint8_t b, uint8_t a) = 0;
    
    /**
     * @brief Present the rendered frame to the display
     */
    virtual void present() = 0;
    
    /**
     * @brief Get the underlying SDL renderer for direct operations
     * @return Pointer to SDL_Renderer
     * @note This is provided for compatibility with existing code
     */
    virtual SDL_Renderer* getSDLRenderer() = 0;
    
    /**
     * @brief Get the current window size (interface method)
     * @param width Output parameter for window width
     * @param height Output parameter for window height
     */
    virtual void getWindowDimensions(int& width, int& height) const = 0;
    
    /**
     * @brief Set the render viewport
     * @param viewport Viewport rectangle
     */
    virtual void setViewport(const SDL_Rect* viewport) = 0;
    
    /**
     * @brief Set the render scale
     * @param scaleX Horizontal scale factor
     * @param scaleY Vertical scale factor
     */
    virtual void setScale(float scaleX, float scaleY) = 0;
};
