VISH
0.2
|
An OpenGL shading program. More...
#include </home/werner/origo/vish/ocean/GLvish/Shader.hpp>
An OpenGL shading program.
The value of a floating point slot may be directly assigned to a uniform shader variable:
scaleFactor << Context > MyProgram;
An additional function may be applied during assignment:
scaleFactor << Context > (MyProgram + pow10);
Construct a program with vertex and fragment shader code.
The specified vertex and fragment shader codes are compiled and linked immediatly.
The most trivial vertex shade is this:
void main(void) { gl_Position = ftransform(); }
The most trivial fragment shader is this:
void main (void) { gl_FragColor = gl_Color; }
void Wizt::GLProgram::bindFragData | ( | GLuint | colorNumber, |
const char * | name | ||
) | const |
GLint Wizt::GLProgram::getAttribID | ( | const char * | name | ) | const |
Get the identifier of some attribute (uniform variable) as defined in the Program.
Attributes are values that are provided per vertex and declared in the Program using GSGL like in this following code fragment:
attribute float value;
GLint Wizt::GLProgram::getAttribID | ( | const string & | name | ) | const [inline] |
Get the identifier of some attribute variable as defined in the Program.
Attributes are values that are provided per vertex and declared in the Program using GSGL like in this following code fragment:
attribute float value;
bool Wizt::GLProgram::isValid | ( | ) | const |
Validates that this program is ready to use.
http://www.opengl.org/sdk/docs/man/xhtml/glValidateProgram.xml
bool Wizt::GLProgram::setUniformValuef | ( | const char * | name, |
float | value | ||
) | const |
Set a variable in the program to a certain value.
name | The variable as given in the program. |
void Wizt::GLProgram::setUniformValuei | ( | const char * | name, |
GLint | v0, | ||
GLint | v1 | ||
) | const |
Return some context on how to address a uniform variable in the shader.
Used for the >> operator.
If this boolean is set to true, then assignments to non existent uniform variables are silently ignored.
Note that a shader program may well contain uniform variables in its source code, but they may vanish during optimized compilation. Setting this flag allows to still assign such removed variables. The default value is false.