|
| ShaderProgram (const std::string &vertex_shader_file="", const std::string &fragment_shader_file="", const std::string &geometry_shader_file="") |
|
const std::string & | getVertexShaderFileName () const |
|
const std::string & | getFragmentShaderFileName () const |
|
const std::string & | getGeometryShaderFileName () const |
|
const std::string & | getVertexShaderSource () const |
|
const std::string & | getFragmentShaderSource () const |
|
const std::string & | getGeometryShaderSource () const |
|
void | setVertexShaderFileName (const std::string &vertex_shader_file) |
|
void | setFragmentShaderFileName (const std::string &fragment_shader_file) |
|
void | setGeometryShaderFileName (const std::string &geometry_shader_file) |
|
void | setVertexShaderSource (const std::string &vertex_shader_src) |
|
void | setFragmentShaderSource (const std::string &fragment_shader_src) |
|
void | setGeometryShaderSource (const std::string &geometry_shader_src) |
|
void | clearShader () |
|
bool | initShader () |
|
bool | parseShader (const std::string &filename, std::string &source) |
|
bool | compileShader (const std::string &vertex_shader_src, const GLuint &vtxShader) |
|
bool | linkProgram () |
|
void | clearAttributeLocations () |
|
void | clearUniformLocations () |
|
bool | updateShader () |
| Initialize or re-link the shader as required.
|
|
bool | isValid () const |
|
void | bind () |
|
GLuint | handle () const |
|
void | setPositionAttributeName (const std::string &attrib_name) |
|
const std::string & | getPositionAttributeName () const |
| Get attribute name for vertex positions.
|
|
int | getAttributeLocation (const std::string &attrib_name) const |
|
int | getPositionAttributeLocation () |
|
void | setPositionAttributePointer (int stride=0, int offset=0, int size=3) |
|
void | disablePositionAttributeArray () |
|
void | setNormalAttributeName (const std::string &attrib_name) |
|
const std::string & | getNormalAttributeName () const |
| Get attribute name for normal vectors.
|
|
int | getNormalAttributeLocation () |
|
void | setNormalAttributePointer (int stride=0, int offset=0, int size=3) |
|
void | disableNormalAttributeArray () |
|
void | setTangentAttributeName (const std::string &attrib_name) |
|
const std::string & | getTangentAttributeName () const |
| Get attribute name for tangent vectors.
|
|
int | getTangentAttributeLocation () |
|
void | setTangentAttributePointer (int stride=0, int offset=0, int size=3) |
|
void | disableTangentAttributeArray () |
|
void | setVertexColorAttributeName (const std::string &attrib_name) |
|
const std::string & | getVertexColorAttributeName () const |
| Get attribute name for color vectors.
|
|
int | getVertexColorAttributeLocation () |
|
void | setVertexColorAttributePointer (int stride=0, int offset=0, int size=4) |
|
void | disableVertexColorAttributeArray () |
|
void | setTextureCoordinateAttributeName (const std::string &attrib_name) |
|
const std::string & | getTextureCoordinateAttributeName () const |
| Get attribute name for texture coordinates.
|
|
int | getTextureCoordinateAttributeLocation () |
|
void | setTextureCoordinateAttributePointer (int stride=0, int offset=0, int size=2) |
|
void | disableTextureCoordinateAttributeArray () |
|
void | setBoneWeightsAttributeName (const std::string &attrib_name) |
|
const std::string & | getBoneWeightsAttributeName () const |
| Get attribute name for bone weights.
|
|
int | getBoneWeightsAttributeLocation () |
|
void | setBoneWeightsAttributePointer (int stride=0, int offset=0, int size=4) |
|
void | disableBoneWeightsAttributeArray () |
|
void | setBoneIndicesAttributeName (const std::string &attrib_name) |
|
const std::string & | getBoneIndicesAttributeName () const |
| Get attribute name for bone weights.
|
|
int | getBoneIndicesAttributeLocation () |
|
void | setBoneIndicesAttributePointer (int stride=0, int offset=0, int size=4) |
|
void | disableBoneIndicesAttributeArray () |
|
void | bindAttributeLocation (const std::string &name, int loc) |
|
void | setAttributeLocation (const std::string &name, int loc) |
|
void | setUniformName (int uni_type, const std::string &name) |
|
const std::string & | getUniformName (int uni_type) |
|
const std::map< int, std::string > & | getUniformNames () const |
|
int | getUniformLocation (int ptype) |
|
int | getUniformLocation (const std::string &name) |
|
bool | hasUniform (int ptype) |
|
bool | hasUniform (const std::string &name) |
|
void | setUniform (const STK::Uniform &uni) |
|
void | setUniform (int ptype, const STK::Matrix4x4f &m) |
| Apply matrix value to the given uniform parameter.
|
|
void | setUniform (int ptype, const std::vector< STK::Matrix4x4f > &marr) |
|
void | setUniform (int ptype, const STK::Vector3f &v) |
| Apply vector value to the given uniform parameter.
|
|
void | setUniform (int ptype, const STK::Vector2f &v) |
| Apply vector value to the given uniform parameter.
|
|
void | setUniform (int ptype, float val) |
| Apply float value to the given uniform parameter.
|
|
void | setUniform (int ptype, float x, float y) |
| Apply 2D float value to the given uniform parameter.
|
|
void | setUniform (int ptype, float x, float y, float z) |
| Apply 3D float value to the given uniform parameter.
|
|
void | setUniform (int ptype, float x, float y, float z, float w) |
| Apply 4D float value to the given uniform parameter.
|
|
void | setUniform (int ptype, const STK::Vector4f &v) |
| Apply 4D float value to the given uniform parameter.
|
|
void | setUniform (int ptype, GLint val) |
| Apply integer value to the given uniform parameter.
|
|
void | setUniform (int ptype, GLuint val) |
| Apply integer value to the given uniform parameter.
|
|
void | setUniform (const std::string &name, const STK::Matrix4x4f &m) |
| Apply matrix value to the given uniform parameter.
|
|
void | setUniform (const std::string &name, const STK::Vector4f &v) |
| Apply vector value to the given uniform parameter.
|
|
void | setUniform (const std::string &name, const STK::Color4f &c) |
| Apply color value to the given uniform parameter.
|
|
void | setUniform (const std::string &name, const STK::Vector3f &v) |
| Apply vector value to the given uniform parameter.
|
|
void | setUniform (const std::string &name, const STK::Vector2f &v) |
| Apply vector value to the given uniform parameter.
|
|
void | setUniform (const std::string &name, float val) |
| Apply float value to the given uniform parameter.
|
|
void | setUniform (const std::string &name, float x, float y) |
| Apply 2D float value to the given uniform parameter.
|
|
void | setUniform (const std::string &name, float x, float y, float z) |
| Apply 3D float value to the given uniform parameter.
|
|
void | setUniform (const std::string &name, float x, float y, float z, float w) |
| Apply 4D float value to the given uniform parameter.
|
|
void | setUniform (const std::string &name, GLint val) |
| Apply integer value to the given uniform parameter.
|
|
void | setUniform (const std::string &name, GLuint val) |
| Apply integer value to the given uniform parameter.
|
|
void | define (const std::string &define) |
|
void | undefine (const std::string &define) |
|
bool | isDefined (const std::string &define) const |
|
ShaderProgram - Wrapper class for an OpenGL shader program You can specify the shader source either by file name or by a source code string. If a file name is given, this will be read and parsed to the source string variable. If you want to re-parse the source file, you need to clear the source string.
Geometry shaders are currently unsupported on the GL ES targets.