eXperiment robotics framework

GPGPU::GLSLProgram Class Reference

#include <GLSLProgram.h>

Collaboration diagram for GPGPU::GLSLProgram:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 GLSLProgram ()
virtual ~GLSLProgram ()
virtual void setSource (const std::string &src)
 Set program source code.
virtual void setEntryPoint (const std::string &src)
virtual void initialise ()
 Compile and initialize the program.
virtual void setParameter (const std::string &name, float x, float y, float z, float w)
 Functions to set parameters 1,2,3,4 floats.
virtual void setParameter (const std::string &name, const float matrix[16])
 4x4 matrix
virtual void setParameter (const std::string &name, TexturePtr tex)
 Texture (sampler).
std::vector< TexturePtr > & getTextureUnits ()
 Get texture units configuration for program from parameters.
void bind ()
 Bind program and its parameters Changes to the parameters while the program is bound must reflect in the rendering API.
void unbind ()
 Unbind program and its parameters.
 GLSLProgram ()
virtual ~GLSLProgram ()
virtual void setSource (const std::string &src)
 Set program source code.
virtual void setEntryPoint (const std::string &src)
virtual void initialise ()
 Compile and initialize the program.
virtual void setParameter (const std::string &name, float x, float y, float z, float w)
 Functions to set parameters 1,2,3,4 floats.
virtual void setParameter (const std::string &name, const float matrix[16])
 4x4 matrix
virtual void setParameter (const std::string &name, TexturePtr tex)
 Texture (sampler).
std::vector< TexturePtr > & getTextureUnits ()
 Get texture units configuration for program from parameters.
void bind ()
 Bind program and its parameters Changes to the parameters while the program is bound must reflect in the rendering API.
void unbind ()
 Unbind program and its parameters.

Private Types

enum  ParameterClass {
  PC_REAL, PC_MATRIX, PC_SAMPLER, PC_REAL,
  PC_MATRIX, PC_SAMPLER
}
enum  ParameterClass {
  PC_REAL, PC_MATRIX, PC_SAMPLER, PC_REAL,
  PC_MATRIX, PC_SAMPLER
}
typedef std::map< std::string,
ParameterDefinition
ParameterDefinitionMap
typedef std::map< std::string,
ParameterDefinition
ParameterDefinitionMap

Private Member Functions

void updateParameter (ParameterDefinition &param)
 Update parameter from memory to card.
void updateParameter (ParameterDefinition &param)
 Update parameter from memory to card.

Private Attributes

bool mIsBound
std::string mSourceCode
std::vector< TexturePtr > mTextureUnits
GLuint mObjFP
GLuint mProgram
ParameterDefinitionMap mParameterDefinitions
std::vector< TexturePtr > mTextureUnits

Classes

struct  ParameterDefinition


Detailed Description

Definition at line 25 of file GLSLProgram.h.


Member Typedef Documentation

typedef std::map<std::string, ParameterDefinition> GPGPU::GLSLProgram::ParameterDefinitionMap [private]

Definition at line 79 of file GLSLProgram.h.

typedef std::map<std::string, ParameterDefinition> GPGPU::GLSLProgram::ParameterDefinitionMap [private]

Definition at line 79 of file GLSLProgram2.hpp.


Member Enumeration Documentation

Enumerator:
PC_REAL 
PC_MATRIX  Float, bool or int.
PC_SAMPLER  Matrix.

Sampler

PC_REAL 
PC_MATRIX  Float, bool or int.
PC_SAMPLER  Matrix.

Sampler

Definition at line 63 of file GLSLProgram.h.

Enumerator:
PC_REAL 
PC_MATRIX  Float, bool or int.
PC_SAMPLER  Matrix.

Sampler

PC_REAL 
PC_MATRIX  Float, bool or int.
PC_SAMPLER  Matrix.

Sampler

Definition at line 63 of file GLSLProgram2.hpp.


Constructor & Destructor Documentation

GPGPU::GLSLProgram::GLSLProgram (  ) 

virtual GPGPU::GLSLProgram::~GLSLProgram (  )  [virtual]

GPGPU::GLSLProgram::GLSLProgram (  ) 

virtual GPGPU::GLSLProgram::~GLSLProgram (  )  [virtual]


Member Function Documentation

virtual void GPGPU::GLSLProgram::setSource ( const std::string &  src  )  [virtual]

Set program source code.

virtual void GPGPU::GLSLProgram::setEntryPoint ( const std::string &  src  )  [virtual]

virtual void GPGPU::GLSLProgram::initialise (  )  [virtual]

Compile and initialize the program.

virtual void GPGPU::GLSLProgram::setParameter ( const std::string &  name,
float  x,
float  y,
float  z,
float  w 
) [virtual]

Functions to set parameters 1,2,3,4 floats.

virtual void GPGPU::GLSLProgram::setParameter ( const std::string &  name,
const float  matrix[16] 
) [virtual]

4x4 matrix

virtual void GPGPU::GLSLProgram::setParameter ( const std::string &  name,
TexturePtr  tex 
) [virtual]

Texture (sampler).

std::vector<TexturePtr>& GPGPU::GLSLProgram::getTextureUnits (  ) 

Get texture units configuration for program from parameters.

void GPGPU::GLSLProgram::bind (  ) 

Bind program and its parameters Changes to the parameters while the program is bound must reflect in the rendering API.

void GPGPU::GLSLProgram::unbind (  ) 

Unbind program and its parameters.

void GPGPU::GLSLProgram::updateParameter ( ParameterDefinition param  )  [private]

Update parameter from memory to card.

virtual void GPGPU::GLSLProgram::setSource ( const std::string &  src  )  [virtual]

Set program source code.

virtual void GPGPU::GLSLProgram::setEntryPoint ( const std::string &  src  )  [virtual]

virtual void GPGPU::GLSLProgram::initialise (  )  [virtual]

Compile and initialize the program.

virtual void GPGPU::GLSLProgram::setParameter ( const std::string &  name,
float  x,
float  y,
float  z,
float  w 
) [virtual]

Functions to set parameters 1,2,3,4 floats.

virtual void GPGPU::GLSLProgram::setParameter ( const std::string &  name,
const float  matrix[16] 
) [virtual]

4x4 matrix

virtual void GPGPU::GLSLProgram::setParameter ( const std::string &  name,
TexturePtr  tex 
) [virtual]

Texture (sampler).

std::vector<TexturePtr>& GPGPU::GLSLProgram::getTextureUnits (  ) 

Get texture units configuration for program from parameters.

void GPGPU::GLSLProgram::bind (  ) 

Bind program and its parameters Changes to the parameters while the program is bound must reflect in the rendering API.

void GPGPU::GLSLProgram::unbind (  ) 

Unbind program and its parameters.

void GPGPU::GLSLProgram::updateParameter ( ParameterDefinition param  )  [private]

Update parameter from memory to card.


Member Data Documentation

bool GLSLProgram::mIsBound [private]

Definition at line 58 of file GLSLProgram.h.

std::string GLSLProgram::mSourceCode [private]

Definition at line 59 of file GLSLProgram.h.

std::vector<TexturePtr> GPGPU::GLSLProgram::mTextureUnits [private]

Definition at line 60 of file GLSLProgram.h.

GLuint GLSLProgram::mObjFP [private]

Definition at line 61 of file GLSLProgram.h.

GLuint GLSLProgram::mProgram [private]

Definition at line 61 of file GLSLProgram.h.

Definition at line 80 of file GLSLProgram.h.

std::vector<TexturePtr> GPGPU::GLSLProgram::mTextureUnits [private]

Definition at line 60 of file GLSLProgram2.hpp.


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

The miarn project - written by Joao Xavier