All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Pages
Luminous::TextureGL Class Reference

This class represents a Texture object in GPU memory. More...

#include <Luminous/TextureGL.hpp>

Inheritance diagram for Luminous::TextureGL:
Luminous::ResourceHandleGL

Public Member Functions

void bind (int textureUnit)
 Bind the texture to the given texture unit. More...
 
QRegion & dirtyRegion2D ()
 Get the dirty region of the texture. More...
 
LUMINOUS_API TextureGLoperator= (TextureGL &&t)
 Move assignment operator. More...
 
LUMINOUS_API void setTexParameters () const
 Apply the texture parameters to OpenGL state.
 
LUMINOUS_API TextureGL (StateGL &state)
 Constructor. More...
 
LUMINOUS_API TextureGL (TextureGL &&t)
 Move constructor. More...
 
LUMINOUS_API void upload (const Texture &texture, int textureUnit, bool forceBind)
 Upload texture data from CPU object. More...
 
LUMINOUS_API ~TextureGL ()
 Destructor.
 
- Public Member Functions inherited from Luminous::ResourceHandleGL
bool expired () const
 Check if the resource has expired. More...
 
GLuint handle () const
 Get the raw OpenGL handle for the resource. More...
 
ResourceHandleGLoperator= (ResourceHandleGL &&r)
 Move assignment operator. More...
 
 ResourceHandleGL (StateGL &state)
 Constructor. More...
 
 ResourceHandleGL (ResourceHandleGL &&r)
 Move constructor. More...
 
void setExpirationSeconds (unsigned int secs)
 Set the expiration time in seconds for the resource. More...
 
void touch ()
 Update the last used timestamp to current frame-time. More...
 

Additional Inherited Members

- Protected Attributes inherited from Luminous::ResourceHandleGL
GLuint m_handle
 Raw OpenGL handle of the resource.
 
StateGLm_state
 OpenGL state owned by the graphics driver.
 

Detailed Description

This class represents a Texture object in GPU memory.

Constructor & Destructor Documentation

LUMINOUS_API Luminous::TextureGL::TextureGL ( StateGL state)

Constructor.

Parameters
stateOpenGL state
LUMINOUS_API Luminous::TextureGL::TextureGL ( TextureGL &&  t)

Move constructor.

Parameters
ttexture object to move

Member Function Documentation

void Luminous::TextureGL::bind ( int  textureUnit)
inline

Bind the texture to the given texture unit.

Parameters
textureUnittexture unit to bind to
QRegion & Luminous::TextureGL::dirtyRegion2D ( )
inline

Get the dirty region of the texture.

The dirty region keeps track of regions in the texture that must be re-uploaded.

Returns
texture dirty region
LUMINOUS_API TextureGL& Luminous::TextureGL::operator= ( TextureGL &&  t)

Move assignment operator.

Parameters
ttexture object to move
LUMINOUS_API void Luminous::TextureGL::upload ( const Texture texture,
int  textureUnit,
bool  forceBind 
)

Upload texture data from CPU object.

Parameters
texturetexture to upload from
textureUnitTexture unit, starting from 0
forceBindforce binding of texture even if it is already active