#include <Shader.h>
|
| Shader (const char *vertexPath, const char *fragmentPath) |
|
void | use () |
|
void | setBool (const std::string &name, bool value) const |
|
void | setInt (const std::string &name, int value) const |
|
void | setFloat (const std::string &name, float value) const |
|
void | setMat4 (const std::string &name, glm::mat4 value) const |
|
void | setVec3 (const std::string &name, glm::vec3 value) const |
|
void | setVec4 (const std::string &name, glm::vec4 value) const |
|
void | vertexAttribPointer (int index, int length, int type, int totalSize) |
|
Makes OpenGL shader creation easier by providing simple functions.
◆ Shader()
Shader::Shader |
( |
const char * | vertexPath, |
|
|
const char * | fragmentPath ) |
The ID to assign the shader to.
◆ setBool()
void Shader::setBool |
( |
const std::string & | name, |
|
|
bool | value ) const |
Sets a boolean uniform in the shader.
- Parameters
-
name | The name of the uniform. |
value | The value to set it to. |
◆ setFloat()
void Shader::setFloat |
( |
const std::string & | name, |
|
|
float | value ) const |
Sets a float uniform in the shader.
- Parameters
-
name | The name of the uniform. |
value | The value to set it to. |
◆ setInt()
void Shader::setInt |
( |
const std::string & | name, |
|
|
int | value ) const |
Sets an integer uniform in the shader.
- Parameters
-
name | The name of the uniform. |
value | The value to set it to. |
◆ setMat4()
void Shader::setMat4 |
( |
const std::string & | name, |
|
|
glm::mat4 | value ) const |
Sets a mat4 uniform in the shader.
- Parameters
-
name | The name of the uniform. |
value | The value to set it to. |
◆ setVec3()
void Shader::setVec3 |
( |
const std::string & | name, |
|
|
glm::vec3 | value ) const |
Sets a vec3 uniform in the shader.
- Parameters
-
name | The name of the uniform. |
value | The value to set it to. |
◆ setVec4()
void Shader::setVec4 |
( |
const std::string & | name, |
|
|
glm::vec4 | value ) const |
Sets a vec4 uniform in the shader.
- Parameters
-
name | The name of the uniform. |
value | The value to set it to. |
◆ use()
The ID to assign the shader to.
◆ vertexAttribPointer()
void Shader::vertexAttribPointer |
( |
int | index, |
|
|
int | length, |
|
|
int | type, |
|
|
int | totalSize ) |
Create a vertex attribute pointer.
- Parameters
-
index | The index in the vertices array. |
length | The length of the vertex attribute pointer (ex. a vec3 would be 3). |
type | The type of the data in the vertices array. |
totalSize | The length of 1 vertex in the vertices array. |
◆ ID
The ID to assign the shader to.
The documentation for this class was generated from the following files:
- BMC-ENGINE/rendering/shaders/Shader.h
- BMC-ENGINE/rendering/shaders/Shader.cpp