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

This class represents the Program object in GPU memory. More...

#include <Luminous/ProgramGL.hpp>

Inheritance diagram for Luminous::ProgramGL:
Luminous::ResourceHandleGL

Public Member Functions

LUMINOUS_API int attributeLocation (const QByteArray &name)
 Get the location of the given attribute. More...
 
LUMINOUS_API void bind ()
 Bind the program.
 
LUMINOUS_API void bind (const Program &program)
 Bind the program optinally linking it. More...
 
LUMINOUS_API void link (const Program &program)
 Link the program. More...
 
LUMINOUS_API ProgramGLoperator= (ProgramGL &&program)
 Move assignment operator. More...
 
LUMINOUS_API ProgramGL (StateGL &state, const Program &program)
 Constructor. More...
 
LUMINOUS_API ProgramGL (ProgramGL &&program)
 Move constructor. More...
 
LUMINOUS_API int uniformBlockLocation (const QByteArray &blockname)
 Get the location of the given uniform block. More...
 
LUMINOUS_API int uniformLocation (const QByteArray &name)
 Get the location of the given uniform. More...
 
LUMINOUS_API const
VertexDescription
vertexDescription () const
 Get the vertex description associated with the program. More...
 
LUMINOUS_API ~ProgramGL ()
 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 the Program object in GPU memory.

Constructor & Destructor Documentation

LUMINOUS_API Luminous::ProgramGL::ProgramGL ( StateGL state,
const Program program 
)

Constructor.

Parameters
stateOpenGL state
programprogram object in CPU
LUMINOUS_API Luminous::ProgramGL::ProgramGL ( ProgramGL &&  program)

Move constructor.

Parameters
programprogram object to move

Member Function Documentation

LUMINOUS_API int Luminous::ProgramGL::attributeLocation ( const QByteArray &  name)

Get the location of the given attribute.

Parameters
nameattribute name
Returns
index of the attribute location or -1 if not found
LUMINOUS_API void Luminous::ProgramGL::bind ( const Program program)

Bind the program optinally linking it.

Parameters
programprogram object on CPU
LUMINOUS_API void Luminous::ProgramGL::link ( const Program program)

Link the program.

Parameters
programprogram object on CPU
LUMINOUS_API ProgramGL& Luminous::ProgramGL::operator= ( ProgramGL &&  program)

Move assignment operator.

Parameters
programprogram object to move
LUMINOUS_API int Luminous::ProgramGL::uniformBlockLocation ( const QByteArray &  blockname)

Get the location of the given uniform block.

Parameters
blocknameuniform block name
Returns
index of the location of the uniform block or -1 if not found
LUMINOUS_API int Luminous::ProgramGL::uniformLocation ( const QByteArray &  name)

Get the location of the given uniform.

Parameters
nameuniform name to query
Returns
index of the uniform location or -1 if not found
LUMINOUS_API const VertexDescription& Luminous::ProgramGL::vertexDescription ( ) const
inline

Get the vertex description associated with the program.

Returns
vertex description