forked from jaildesigner-jailgames/jaildoctors_dilemma
- [WIP] Modificaciones a la clase Textura
This commit is contained in:
@@ -11,26 +11,28 @@ class Texture
|
||||
{
|
||||
private:
|
||||
// Objetos y punteros
|
||||
SDL_Texture *texture; // La textura
|
||||
uint8_t *pixels; // Los pixels de esta textura
|
||||
SDL_Texture *texture; // La textura SDL sobre la que pintaremos (debe haber sido creada con SDL_TEXTUREACCESS_STREAMING)
|
||||
SDL_Renderer *renderer; // Renderizador donde dibujar la textura
|
||||
|
||||
// Variables
|
||||
int width; // Ancho de la imagen
|
||||
int height; // Alto de la imagen
|
||||
std::string path; // Ruta de la imagen de la textura
|
||||
uint32_t color; // Color para el pintado de 1 bit (sprites y tal)
|
||||
|
||||
public:
|
||||
// Constructor
|
||||
Texture(SDL_Renderer *renderer, std::string path = "", bool verbose = false);
|
||||
Texture(SDL_Renderer *renderer, SDL_Texture *texture, std::string path = "", bool verbose = false);
|
||||
|
||||
// Destructor
|
||||
~Texture();
|
||||
|
||||
// Carga una imagen desde un fichero
|
||||
bool loadFromFile(std::string path, SDL_Renderer *renderer, bool verbose = false);
|
||||
bool loadFromFile(std::string path, bool verbose = false);
|
||||
|
||||
// Crea una textura en blanco
|
||||
bool createBlank(SDL_Renderer *renderer, int width, int height, SDL_TextureAccess = SDL_TEXTUREACCESS_STREAMING);
|
||||
bool createBlank(int width, int height, SDL_TextureAccess = SDL_TEXTUREACCESS_STREAMING);
|
||||
|
||||
// Libera la memoria de la textura
|
||||
void unload();
|
||||
|
||||
Reference in New Issue
Block a user