PROTO::KLUDGE  0.1
Quick prototyping library for games using SDL and OpenGL.
pk::Texture Class Reference

A class implemented using the Facade pattern used for loading SDL_Texture data. More...

#include <Texture.hpp>

Collaboration diagram for pk::Texture:
Collaboration graph

Public Member Functions

 Texture ()
 Default constructor. More...
 
virtual ~Texture ()
 
bool loadTexture (const char *path, SDL_Renderer *const renderTarget)
 
bool loadTexture (SDL_Texture *const texture)
 Load the texture from an existing SDL_Texture. More...
 
SDL_Texture * getTexture ()
 Get the SDL_Texture from the Texture. More...
 
int getWidth ()
 Get the width of the SDL_Texture. More...
 
int getHeight ()
 Get the height of the SDL_Texture. More...
 

Private Attributes

SDL_Texture * m_texture
 Pointer to the SDL_Texture data. More...
 
int m_width
 The width of the Texture in pixels. More...
 
int m_height
 The height of the Texture in pixels. More...
 

Detailed Description

A class implemented using the Facade pattern used for loading SDL_Texture data.

Constructor & Destructor Documentation

◆ Texture()

pk::Texture::Texture ( )

Default constructor.

◆ ~Texture()

virtual pk::Texture::~Texture ( )
virtual

Member Function Documentation

◆ getHeight()

int pk::Texture::getHeight ( )
inline

Get the height of the SDL_Texture.

Returns
int - the height of the texture.

◆ getTexture()

SDL_Texture * pk::Texture::getTexture ( )
inline

Get the SDL_Texture from the Texture.

Returns
SDL_Texture * - a pointer to an SDL_Texture object.

◆ getWidth()

int pk::Texture::getWidth ( )
inline

Get the width of the SDL_Texture.

Returns
int - the width of the texture.

◆ loadTexture() [1/2]

bool pk::Texture::loadTexture ( const char *  path,
SDL_Renderer *const  renderTarget 
)

◆ loadTexture() [2/2]

bool pk::Texture::loadTexture ( SDL_Texture *const  texture)

Load the texture from an existing SDL_Texture.

Parameters
SDL_Texture* const texture - const pointer to an SDL_Texture.

Member Data Documentation

◆ m_height

int pk::Texture::m_height
private

The height of the Texture in pixels.

◆ m_texture

SDL_Texture* pk::Texture::m_texture
private

Pointer to the SDL_Texture data.

◆ m_width

int pk::Texture::m_width
private

The width of the Texture in pixels.


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