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

namespace draw
{
    enum flip { none, horizontal, vertical, both };

    void init(const char *titol, const uint16_t width, const uint16_t height);
    void resizeSystemTexture(const uint16_t width, const uint16_t height);
    void quit();

    SDL_Texture *createSurface(const uint16_t w, const uint16_t h);
    SDL_Texture *loadSurface(const char* filename, const int transparent = -1);
    void freeSurface(SDL_Texture *surf);
    void setDestination(SDL_Texture *surf);
    void setSource(SDL_Texture *surf);

    void setClip(const int x, const int y, const int w, const int h);
    void resetClip();

    SDL_Point getWindowSize();
    
    void setColor(const uint32_t col);
    void cls(const uint32_t color);
    void line(const int x1, const int y1, const int x2, const int y2);
    void fillrect(const int x, const int y, const int w, const int h);
    void rect(const int x, const int y, const int w, const int h);

    void draw(const SDL_Rect source, const SDL_Rect dest, const SDL_FlipMode flip = SDL_FLIP_NONE);
    //void draw(const int x, const int y);
    //void draw();
    //void draw(SDL_Texture* surf);


    void render();
}
