Lums
Public Member Functions | List of all members
lm::Texture Class Reference

A class representing a texture in the GPU. More...

#include <Texture.hpp>

Public Member Functions

 Texture ()
 
float width () const
 
float height () const
 
float bufferWidth () const
 
float bufferHeight () const
 
void setImage (Image &image)
 
void load ()
 
void unload ()
 
void bind () const
 
void pushAtlas (const Rect2f &rect)
 
void pushAtlas (int w, int h)
 
const Rect2fatlas (std::size_t i) const
 
bool loaded () const
 
 ~Texture ()
 

Detailed Description

A class representing a texture in the GPU.

Constructor & Destructor Documentation

lm::Texture::Texture ( )

Create a texture

lm::Texture::~Texture ( )

Texture dtor

Member Function Documentation

const Rect2f& lm::Texture::atlas ( std::size_t  i) const

Get a rect from the atlas

Parameters
iThe atlas index
Returns
The rect
void lm::Texture::bind ( ) const

Bind the texture

float lm::Texture::bufferHeight ( ) const
inline

Get the texture buffer height

Returns
The texture buffer height
float lm::Texture::bufferWidth ( ) const
inline

Get the texture buffer width

Returns
The texture buffer width
float lm::Texture::height ( ) const
inline

Get the texture height

Returns
The texture height
void lm::Texture::load ( )

Load the texture

bool lm::Texture::loaded ( ) const

Check wether a texture is loaded

Returns
true if the texture is loaded, false otherwise
void lm::Texture::pushAtlas ( const Rect2f rect)

Add a rect to the texture atlas

Parameters
rectThe rect to be added
void lm::Texture::pushAtlas ( int  w,
int  h 
)

Cut the texture into equal parts

Parameters
wthe texture part width
hthe texture part height
void lm::Texture::setImage ( Image image)

Set the texture image.

Parameters
imageThe image
void lm::Texture::unload ( )

Unload the texture

float lm::Texture::width ( ) const
inline

Get the texture width

Returns
The texture width

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