gonna fer un commit per si reventa algo: estic a meitat implementar surfaces

This commit is contained in:
2025-02-28 22:58:01 +01:00
parent 5bb2b5e7c4
commit 5ff04daf20
14 changed files with 511 additions and 157 deletions

View File

@@ -11,7 +11,7 @@
struct Color;
// Definiciones de tipos
struct Surface
/*struct Surface
{
std::shared_ptr<Uint8[]> data;
Uint16 w, h;
@@ -19,7 +19,7 @@ struct Surface
// Constructor
Surface(Uint16 width, Uint16 height, std::shared_ptr<Uint8[]> pixels)
: data(pixels), w(width), h(height) {}
};
};*/
class Texture
{
@@ -27,7 +27,7 @@ private:
// Objetos y punteros
SDL_Renderer *renderer_; // Renderizador donde dibujar la textura
SDL_Texture *texture_ = nullptr; // La textura
std::shared_ptr<Surface> surface_ = nullptr; // Surface para usar imagenes en formato gif con paleta
//std::shared_ptr<Surface> surface_ = nullptr; // Surface para usar imagenes en formato gif con paleta
// Variables
std::string path_; // Ruta de la imagen de la textura