|
Muto 0.0.1
|
An abstraction for a shader program. More...
#include <Shader.h>
Public Member Functions | |
| virtual void | Bind () const =0 |
| connects the shader program for use. | |
| virtual const std::string & | GetName () const =0 |
| virtual void | SetFloat (const std::string &name, float value)=0 |
| Sets a single float uniform in the shader. | |
| virtual void | SetFloat3 (const std::string &name, const glm::vec3 &value)=0 |
| Sets a 3-component float vector uniform in the shader. | |
| virtual void | SetFloat4 (const std::string &name, const glm::vec4 &value)=0 |
| Sets a 4-component float vector uniform in the shader. | |
| virtual void | SetInt (const std::string &name, int value)=0 |
| Sets a single integer uniform in the shader. | |
| virtual void | SetIntArray (const std::string &name, int *values, uint32_t count)=0 |
| Sets an array of integers uniform in the shader. | |
| virtual void | SetMat4 (const std::string &name, const glm::mat4 &value)=0 |
| Sets a 4x4 matrix uniform in the shader. | |
| virtual void | Unbind () const =0 |
| disconnects the shader program. | |
| virtual | ~Shader ()=default |
Static Public Member Functions | |
| static Ref< Shader > | Create (const std::string &filepath) |
| Creates a shader from a file. | |
| static Ref< Shader > | Create (const std::string &name, const std::string &vertexSrc, const std::string &fragmentSrc) |
| Creates a new shader from vertex and fragment shader source code. | |
An abstraction for a shader program.
|
virtualdefault |
connects the shader program for use.
Implemented in Muto::OpenGLShader.
Creates a shader from a file.
| filepath | The path to the shader file to load. |
References Muto::Renderer::GetAPI(), Muto::RenderAPI::RAPI_None, and Muto::RenderAPI::RAPI_OpenGL.
|
static |
Creates a new shader from vertex and fragment shader source code.
| name | The name to assign to the shader. |
| vertexSrc | The vertex shader source code as a string. |
| fragmentSrc | The fragment shader source code as a string. |
References Muto::Renderer::GetAPI(), Muto::RenderAPI::RAPI_None, and Muto::RenderAPI::RAPI_OpenGL.
Implemented in Muto::OpenGLShader.
Sets a single float uniform in the shader.
Implemented in Muto::OpenGLShader.
|
pure virtual |
Sets a 3-component float vector uniform in the shader.
Implemented in Muto::OpenGLShader.
|
pure virtual |
Sets a 4-component float vector uniform in the shader.
Implemented in Muto::OpenGLShader.
Sets a single integer uniform in the shader.
Implemented in Muto::OpenGLShader.
|
pure virtual |
Sets an array of integers uniform in the shader.
Implemented in Muto::OpenGLShader.
|
pure virtual |
Sets a 4x4 matrix uniform in the shader.
Implemented in Muto::OpenGLShader.
disconnects the shader program.
Implemented in Muto::OpenGLShader.