Assignments
Assignments
|
#include <GLSLProgram.h>
Public Member Functions | |
GLSLProgram (const std::string &vs_filename, const std::string &fs_filename) | |
~GLSLProgram (void) | |
void | compileShader (const std::string &source, GLenum type) |
void | link (void) |
void | validate (void) |
void | use (void) |
GLuint | handle (void) const |
bool | linked (void) const |
void | setUniform (const std::string &name, int val, bool showWarning=true) |
void | setUniform (const std::string &name, float val, bool showWarning=true) |
void | setUniform (const std::string &name, double val, bool showWarning=true) |
template<unsigned int > | |
void | setUniform (const std::string &name, const int *v, bool showWarning=true) |
template<unsigned int > | |
void | setUniform (const std::string &name, const float *v, bool showWarning=true) |
template<unsigned int > | |
void | setUniform (const std::string &name, const double *v, bool showWarning=true) |
template<unsigned int > | |
void | setUniformMatrix (const std::string &name, const float *m, bool showWarning=true) |
template<unsigned int > | |
void | setUniformMatrix (const std::string &name, const double *m, bool showWarning=true) |
void | init (void) |
Static Public Member Functions | |
static bool | FileExists (const std::string &fileName) |
static std::string | GetExtension (const std::string &fileName) |
static GLenum | GetShaderType (const std::string &fileName) |
static std::string | GetShaderTypeString (GLenum type) |
Private Member Functions | |
GLSLProgram (const GLSLProgram &other) | |
GLSLProgram & | operator= (const GLSLProgram &other) |
Static Private Member Functions | |
template<unsigned int Dim> | |
static void | glUniformiv (GLint location, GLsizei count, const GLint *value) |
template<unsigned int Dim> | |
static void | glUniformfv (GLint location, GLsizei count, const GLfloat *value) |
template<unsigned int Dim> | |
static void | glUniformMatrixfv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value) |
template<> | |
void | glUniformiv (GLint location, GLsizei count, const GLint *value) |
template<> | |
void | glUniformiv (GLint location, GLsizei count, const GLint *value) |
template<> | |
void | glUniformiv (GLint location, GLsizei count, const GLint *value) |
template<> | |
void | glUniformiv (GLint location, GLsizei count, const GLint *value) |
template<> | |
void | glUniformfv (GLint location, GLsizei count, const GLfloat *value) |
template<> | |
void | glUniformfv (GLint location, GLsizei count, const GLfloat *value) |
template<> | |
void | glUniformfv (GLint location, GLsizei count, const GLfloat *value) |
template<> | |
void | glUniformfv (GLint location, GLsizei count, const GLfloat *value) |
template<> | |
void | glUniformMatrixfv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value) |
template<> | |
void | glUniformMatrixfv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value) |
template<> | |
void | glUniformMatrixfv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value) |
Private Attributes | |
GLuint | _handle |
bool | _linked |
std::string | _vertexSource |
std::string | _fragmentSource |
This class describes a GLSL program consisting of a vertex and fragment shader.
|
inlineprivate |
GLSLProgram::GLSLProgram | ( | const std::string & | vs_filename, |
const std::string & | fs_filename | ||
) |
GLSLProgram::~GLSLProgram | ( | void | ) |
void GLSLProgram::compileShader | ( | const std::string & | source, |
GLenum | type | ||
) |
This method compiles the specified shader from the source
|
static |
|
static |
|
static |
|
static |
|
staticprivate |
|
staticprivate |
|
staticprivate |
|
staticprivate |
|
staticprivate |
|
staticprivate |
|
staticprivate |
|
staticprivate |
|
staticprivate |
|
staticprivate |
|
staticprivate |
|
staticprivate |
|
staticprivate |
|
staticprivate |
|
inline |
This method return the OpenGL handle to the shader
void GLSLProgram::init | ( | void | ) |
This method sets up the program.
void GLSLProgram::link | ( | void | ) |
This method links together the vertex and fragment shaders
|
inline |
This method return a boolean value indicating if the shader was (successfully) linked
|
inlineprivate |
void GLSLProgram::setUniform | ( | const std::string & | name, |
const double * | v, | ||
bool | showWarning = true |
||
) |
This method sets an an double-precision floating point array uniform value with the specified name. The template parameter indicates the dimensionality of the array.
void GLSLProgram::setUniform | ( | const std::string & | name, |
const float * | v, | ||
bool | showWarning = true |
||
) |
This method sets an an single-precision floating point array uniform value with the specified name. The template parameter indicates the dimensionality of the array.
void GLSLProgram::setUniform | ( | const std::string & | name, |
const int * | v, | ||
bool | showWarning = true |
||
) |
This method sets an an integer array uniform value with the specified name. The template parameter indicates the dimensionality of the array.
void GLSLProgram::setUniform | ( | const std::string & | name, |
double | val, | ||
bool | showWarning = true |
||
) |
This method sets an double-precision floating uniform value with the specified name.
void GLSLProgram::setUniform | ( | const std::string & | name, |
float | val, | ||
bool | showWarning = true |
||
) |
This method sets a single-precision floating point unfiform value with the specified name.
void GLSLProgram::setUniform | ( | const std::string & | name, |
int | val, | ||
bool | showWarning = true |
||
) |
This method sets an integer uniform value with the specified name.
void GLSLProgram::setUniformMatrix | ( | const std::string & | name, |
const double * | m, | ||
bool | showWarning = true |
||
) |
This method sets an a double-precision floating point matrix uniform value with the specified name. The template parameter indicates the dimensionality of the matrix.
void GLSLProgram::setUniformMatrix | ( | const std::string & | name, |
const float * | m, | ||
bool | showWarning = true |
||
) |
This method sets an a single-precision floating point matrix uniform value with the specified name. The template parameter indicates the dimensionality of the matrix.
void GLSLProgram::use | ( | void | ) |
This method enable the program
void GLSLProgram::validate | ( | void | ) |
This method validates that the program was generated successfully
|
private |
|
private |
|
private |
|
private |