Osiris Framework  0.1
OShaderProgram Class Reference

Class that represents a shader program. More...

#include <OsirisSDK/OShaderProgram.h>

Public Member Functions

 OShaderProgram (const char *name)
 Class constructor. More...
 
virtual ~OShaderProgram ()
 Class destructor.
 
GLuint glReference () const
 Returns the OpenGL reference ID.
 
void setCamera (OCamera *camera)
 Set camera that will be used by this shader program. More...
 
void setModelTransformation (const OMatrixStack *modelMtx)
 Set model specific transformations (translations, rotations, scaling). Pointer to the matrix stack containing the transformations. More...
 
void addShader (OShaderObject *shader)
 Add a shader object to the program. More...
 
void addShader (OShaderObject::ShaderType type, const char *name, int resourceId)
 Add a shader object to the program using the Visual Studio resource file ID (WIN32 only). More...
 
void compile ()
 Compiles shader objects and links the shader program.
 

Detailed Description

Class that represents a shader program.

Constructor & Destructor Documentation

OShaderProgram::OShaderProgram ( const char *  name)

Class constructor.

Parameters
nameShader name.

Member Function Documentation

void OShaderProgram::addShader ( OShaderObject shader)

Add a shader object to the program.

Parameters
shaderPointer to the shader object that will be added.
void OShaderProgram::addShader ( OShaderObject::ShaderType  type,
const char *  name,
int  resourceId 
)

Add a shader object to the program using the Visual Studio resource file ID (WIN32 only).

Parameters
typeShader type.
nameShader name.
resourceIdVisual Studio resource file ID that references the shader source code.
void OShaderProgram::setCamera ( OCamera camera)

Set camera that will be used by this shader program.

Parameters
cameraPointer to the camera object.
Todo:
This will be eliminated on the next version. The camera transformations must be included in the transformation matrix stack passed to each mesh during the rendering run.
void OShaderProgram::setModelTransformation ( const OMatrixStack modelMtx)

Set model specific transformations (translations, rotations, scaling). Pointer to the matrix stack containing the transformations.

Todo:
This will be eliminated on the next version. A single matrix will be passed to the shader containing both camera/perspective and model transformations. There will be a single transformation set method.

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