Osiris Framework  0.3
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 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...
 
GLuint uniformLocation (const char *uniform_name)
 Get the shader uniform parameter by name. More...
 
GLuint attribLocation (const char *attrib_name)
 Get the shader attribute by name. More...
 
void compile ()
 Compiles shader objects and links the shader program.
 
void use ()
 Tells OpenGL to use the program for the next rendering iteration.
 

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.
GLuint OShaderProgram::attribLocation ( const char *  attrib_name)

Get the shader attribute by name.

Parameters
attrib_nameName of the shader attribute.
Returns
The OpenGL reference to the attribute.
GLuint OShaderProgram::uniformLocation ( const char *  uniform_name)

Get the shader uniform parameter by name.

Parameters
uniform_nameName of the uniform parameter.
Returns
The OpenGL reference to the uniform.

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