sdl2dll
Loading...
Searching...
No Matches
sdl::TextureArray Class Reference

Clase que encapsula una única textura compuesta. More...

#include <sdl_texturearray.h>

Public Member Functions

EXPORT TextureArray (Renderer &render, const std::string file, int tileWidth=0, int tileHeight=0)
 Constructor.
 
EXPORT ~TextureArray ()
 Destructor.
 
EXPORT int W ()
 Obtiene la anchura de las subtexturas.
 
EXPORT int H ()
 Obtiene la altura de las subtexturas.
 
SDL_Texture * Get ()
 Obtiene un puntero a la estructura SDL_Texture.
 
EXPORT operator SDL_Texture * ()
 Obtiene un puntero a la estructura SDL_Texture.
 
EXPORT void Draw (Point punto, int index)
 Traslada la subtextura al punto indicado.
 

Protected Attributes

Rendererrenderer
 
SDL_Texture * texture
 
std::vector< Rectrect
 
int w
 
int h
 
int rows
 
int cols
 

Detailed Description

Clase que encapsula una única textura compuesta.

La textura contiene un array de subtexturas del mismo tamaño que pueden ser mostradas individualmente

Constructor & Destructor Documentation

◆ TextureArray()

EXPORT sdl::TextureArray::TextureArray ( Renderer & render,
const std::string file,
int tileWidth = 0,
int tileHeight = 0 )

Constructor.

Parameters
renderRenderer& contexto de renderizado
filestring ruta del fichero que contiene el gráfico de la textura
tileWidthint anchura de cada subtextura
tileHeightint altura de cada subtextura

◆ ~TextureArray()

EXPORT sdl::TextureArray::~TextureArray ( )
inline

Destructor.

Destruye la textura especificada.

Member Function Documentation

◆ Draw()

EXPORT void sdl::TextureArray::Draw ( Point punto,
int index )
inline

Traslada la subtextura al punto indicado.

Parameters
puntoPoint punto de destino
indexint índice de la subtextura

◆ H()

EXPORT int sdl::TextureArray::H ( )
inline

Obtiene la altura de las subtexturas.

Returns
int valor de la altura de las subtexturas

◆ W()

EXPORT int sdl::TextureArray::W ( )
inline

Obtiene la anchura de las subtexturas.

Returns
int valor de la anchura de las subtexturas

Member Data Documentation

◆ cols

int sdl::TextureArray::cols
protected

Número de filas y columnas

◆ h

int sdl::TextureArray::h
protected

Anchura y altura de cada subtextura

◆ rect

std::vector<Rect> sdl::TextureArray::rect
protected

Rectángulos contenedores de subtexturas

◆ renderer

Renderer& sdl::TextureArray::renderer
protected

Contexto de renderizado

◆ texture

SDL_Texture* sdl::TextureArray::texture
protected

Textura


The documentation for this class was generated from the following files: