0.44.0
|
#include <iShaderProgram.h>
Public Member Functions | |
iShaderProgram () | |
virtual | ~iShaderProgram () |
void | addShader (const iaString &filename, iShaderObjectType type) |
const std::vector< iShaderSource > & | getShaderSources () const |
bool | addSource (const char *source, iShaderObjectType type, const iaString &sourceName="") |
void | compile () |
bool | isValid () |
void | bind () |
void | unbind () |
void | setInt (const iaString &uniform, int value) |
void | setFloat (const iaString &uniform, float32 value) |
void | setFloat2 (const iaString &uniform, const iaVector2f &value) |
void | setFloat3 (const iaString &uniform, const iaVector3f &value) |
void | setFloat4 (const iaString &uniform, const iaVector4f &value) |
void | setMatrix (const iaString &uniform, const iaMatrixf &value) |
bool | hasUniformLocation (const iaString &uniform) |
Static Public Member Functions | |
static iShaderProgramPtr | create () |
glsl shader program wrapper
igor::iShaderProgram::iShaderProgram | ( | ) |
initializes shader program
|
virtual |
destroys shader program
void igor::iShaderProgram::addShader | ( | const iaString & | filename, |
iShaderObjectType | type | ||
) |
add shader object from file
filename | file name to shader definition |
type | the type of shader object. |
If type is undefined we use the file ending to determine the type
bool igor::iShaderProgram::addSource | ( | const char * | source, |
iShaderObjectType | type, | ||
const iaString & | sourceName = "" |
||
) |
add shader from buffer
source | pointer to buffer with shader definition (zero terminated) |
type | the type of shader object |
void igor::iShaderProgram::bind | ( | ) |
activates shader program
void igor::iShaderProgram::compile | ( | ) |
compiles shader programm with shader objects
|
static |
const std::vector< iShaderSource > & igor::iShaderProgram::getShaderSources | ( | ) | const |
it does not return sources added via addSource
bool igor::iShaderProgram::hasUniformLocation | ( | const iaString & | uniform | ) |
uniform | the given uniform location |
bool igor::iShaderProgram::isValid | ( | ) |
sets float on given uniform
uniform | the uniform name |
value | the value to set |
void igor::iShaderProgram::setFloat2 | ( | const iaString & | uniform, |
const iaVector2f & | value | ||
) |
sets 2 dimensional vector on given uniform
uniform | the uniform name |
value | the value to set |
void igor::iShaderProgram::setFloat3 | ( | const iaString & | uniform, |
const iaVector3f & | value | ||
) |
sets 3 dimensional vector on given uniform
uniform | the uniform name |
value | the value to set |
void igor::iShaderProgram::setFloat4 | ( | const iaString & | uniform, |
const iaVector4f & | value | ||
) |
sets 4 dimensional vector on given uniform
uniform | the uniform name |
value | the value to set |
void igor::iShaderProgram::setInt | ( | const iaString & | uniform, |
int | value | ||
) |
sets integer on given uniform
uniform | the uniform name |
value | the value to set |
sets 4x4 matrix on given uniform
uniform | the uniform name |
value | the value to set |
void igor::iShaderProgram::unbind | ( | ) |
deactivates shader program