A shader that can be used to render objects to the screen.
More...
#include <shader.h>
|
| Shader () |
| Default empty constructor.
|
|
| Shader (const std::string &filePath) |
| Default constructor to create and load a shader. More...
|
|
| Shader (const char *sourceCode) |
| Constructor that will compile a character array into a shader. More...
|
|
| Shader (ShaderProgramSource) |
| Create a shader from a rune::ShaderProgramSource. More...
|
|
void | makeNewShader (std::string const &filePath) |
| This is the base function that the different constructors call. More...
|
|
void | bind (void) |
| Configure the shader to be active on the GPU, must be done before drawing something.
|
|
int | getShaderID () |
| Get the ID of the shader used by the GPU.
|
|
void | setShader (int shaderID) |
| Set which ID the shader should use to communicate with the GPU.
|
|
void | setUniform1f (std::string const &name, float value) |
| Set a float shader uniform. More...
|
|
void | setUniform2f (std::string const &name, float v0, float v1) |
| Set a vec2 shader uniform. More...
|
|
void | setUniform3f (std::string const &name, float v0, float v1, float v2) |
| Set a vec3 shader uniform.
|
|
void | setUniform4f (std::string const &name, float v0, float v1, float v2, float v3) |
| Set a vec4 shader uniform. More...
|
|
void | setUniform1i (std::string const &name, int value) |
| Set an integer shader uniform. More...
|
|
A shader that can be used to render objects to the screen.
- Author
- Thomas Montano
- Date
- April 25 2020
◆ Shader() [1/3]
rune::Shader::Shader |
( |
const std::string & |
filePath | ) |
|
Default constructor to create and load a shader.
- Parameters
-
filePath | The file path for the shader code to be compiled. |
◆ Shader() [2/3]
rune::Shader::Shader |
( |
const char * |
sourceCode | ) |
|
Constructor that will compile a character array into a shader.
Create a new shader off of a string literal
- Parameters
-
sourceCode | a const char * to the code you would like to use. There are several included in the Rune Engine. |
◆ Shader() [3/3]
◆ makeNewShader()
void rune::Shader::makeNewShader |
( |
std::string const & |
filePath | ) |
|
This is the base function that the different constructors call.
- Parameters
-
filePath | The file path to the GLSL code that should be loaded onto the GPU. |
◆ setUniform1f()
void rune::Shader::setUniform1f |
( |
std::string const & |
name, |
|
|
float |
value |
|
) |
| |
Set a float shader uniform.
- Parameters
-
name | The exact name of the uniform that is being created. |
value | The value being passed to the uniform. |
◆ setUniform1i()
void rune::Shader::setUniform1i |
( |
std::string const & |
name, |
|
|
int |
value |
|
) |
| |
Set an integer shader uniform.
- Parameters
-
name | The exact name of the uniform that is being created. |
value | The value being passed to the uniform. |
◆ setUniform2f()
void rune::Shader::setUniform2f |
( |
std::string const & |
name, |
|
|
float |
v0, |
|
|
float |
v1 |
|
) |
| |
Set a vec2 shader uniform.
- Parameters
-
name | The name of the vec2 to be modified. |
v0 | The x coordinate of the vector. |
v1 | The y coordinate of the vector. |
◆ setUniform4f()
void rune::Shader::setUniform4f |
( |
std::string const & |
name, |
|
|
float |
v0, |
|
|
float |
v1, |
|
|
float |
v2, |
|
|
float |
v3 |
|
) |
| |
Set a vec4 shader uniform.
- Parameters
-
name | The exact name of the uniform that is being created. |
v0 | The value being passed to the uniform. |
v1 | The value being passed to the uniform. |
v2 | The value being passed to the uniform. |
v3 | The value being passed to the uniform. |
The documentation for this class was generated from the following files: