This commit is contained in:
2025-10-27 18:35:53 +01:00
parent b1dca32a5b
commit 3179a08dac
63 changed files with 686 additions and 693 deletions

View File

@@ -23,13 +23,13 @@ class Texture {
public:
// Constructor
explicit Texture(SDL_Renderer* renderer, const std::string& path = std::string());
explicit Texture(SDL_Renderer* renderer, std::string path = std::string());
// Destructor
~Texture();
// Carga una imagen desde un fichero
bool loadFromFile(const std::string& path);
auto loadFromFile(const std::string& path) -> bool;
// Crea una textura en blanco
auto createBlank(int width, int height, SDL_PixelFormat format = SDL_PIXELFORMAT_RGBA8888, SDL_TextureAccess access = SDL_TEXTUREACCESS_STREAMING) -> bool;
@@ -51,17 +51,17 @@ class Texture {
void setAsRenderTarget(SDL_Renderer* renderer);
// Obtiene el ancho de la imagen
int getWidth() const { return width_; }
[[nodiscard]] auto getWidth() const -> int { return width_; }
// Obtiene el alto de la imagen
int getHeight() const { return height_; }
[[nodiscard]] auto getHeight() const -> int { return height_; }
// Recarga la textura
bool reLoad();
auto reLoad() -> bool;
// Obtiene la textura
SDL_Texture* getSDLTexture();
auto getSDLTexture() -> SDL_Texture*;
// Obtiene el renderizador
SDL_Renderer* getRenderer();
auto getRenderer() -> SDL_Renderer*;
};