 |
BARE2D
|
|
Go to the documentation of this file.
4 #include <initializer_list>
25 void compileShaders(
const char* vertexShaderPath,
const char* fragmentShaderPath);
38 void linkShaders(std::initializer_list<std::string> attributes);
46 void setUniform(
const std::string uniform, T* data,
unsigned int num = 1);
55 void setUniformMatrix(
const std::string uniform,
bool transpose, T* data,
unsigned int num = 1);
void setUniformMatrix(const std::string uniform, bool transpose, T *data, unsigned int num=1)
Similar to setUniform.
void use()
Activates this shader program for the renderer to use.
void unuse()
Deactivates this shader program.
void compileShaders(const char *vertexShaderPath, const char *fragmentShaderPath)
Compiles the shaders. Does not link them.
void bindFragOutputLocation(std::string outputVariableName, unsigned int location)
A call to glBindFragDataLocation() - Causes an output variable of the fragment shader to output to a ...
GLuint m_fragmentShaderID
void compileShaderFromSource(const char *source, const std::string &name, GLuint id)
Compiles a shader from source with OpenGL id.
GLint getUniformLocation(const std::string &uniform)
Gets the location of a uniform in a program.
void destroy()
Releases all bound objects and deletes any allocated stuff.
void setUniform(const std::string uniform, T *data, unsigned int num=1)
A generalized wrapper to find and set a uniform for this shader.
The ShaderProgram is a GLSL program which combines two shaders - the vertex shader and the fragment s...
bool doesUniformExist(const std::string uniform)
void linkShaders(std::initializer_list< std::string > attributes)
Links the compiled shaders together to create a coherent shader program.
unsigned int m_numberAttributes
void compileShadersFromSource(const char *vertexSource, const char *fragmentSource)
Similar to compileShaders, this just compiles the shaders.