|
| Shader () noexcept |
| Constructor.
|
|
| Shader (Shader &&) noexcept |
| Move constructor.
|
|
Shader & | operator= (Shader &&) noexcept |
| Move assignment operator.
|
|
| ~Shader () noexcept |
| Destructor.
|
|
bool | load (const std::string &file) noexcept |
| Loads a combined shader.
|
|
bool | load (const std::string &vertex, const std::string &frag) noexcept |
| Loads an OpenGL shader.
|
|
bool | parse (const std::string &src) noexcept |
| Loads a combined raw shader.
|
|
bool | parse (const std::string &vertex, const std::string &frag) noexcept |
| Loads a raw shader.
|
|
void | compile () |
| Compiles shader into GPU mem.
|
|
void | destroy () |
| Destroys shader program.
|
|
void | bind () const |
| Make active shader.
|
|
void | unbind () const |
| Unbind.
|
|
template<typename... Uniforms> |
void | set_uniform (const std::string &name, const Uniforms &... args) |
| Specialized variadic template for setting shader uniforms.
|
|
unsigned int | id () const noexcept |
| Get program id.
|
|
template<> |
void | set_uniform (const std::string &name) |
|
template<> |
void | set_uniform (const std::string &name, const bool &a) |
|
template<> |
void | set_uniform (const std::string &name, const int &a) |
|
template<> |
void | set_uniform (const std::string &name, const int &a, const int &b) |
|
template<> |
void | set_uniform (const std::string &name, const int &a, const int &b, const int &c) |
|
template<> |
void | set_uniform (const std::string &name, const int &a, const int &b, const int &c, const int &d) |
|
template<> |
void | set_uniform (const std::string &name, const unsigned int &a) |
|
template<> |
void | set_uniform (const std::string &name, const unsigned int &a, const unsigned int &b) |
|
template<> |
void | set_uniform (const std::string &name, const unsigned int &a, const unsigned int &b, const unsigned int &c) |
|
template<> |
void | set_uniform (const std::string &name, const unsigned int &a, const unsigned int &b, const unsigned int &c, const unsigned int &d) |
|
template<> |
void | set_uniform (const std::string &name, const float &a) |
|
template<> |
void | set_uniform (const std::string &name, const float &a, const float &b) |
|
template<> |
void | set_uniform (const std::string &name, const float &a, const float &b, const float &c) |
|
template<> |
void | set_uniform (const std::string &name, const float &a, const float &b, const float &c, const float &d) |
|
template<> |
void | set_uniform (const std::string &name, const double &a) |
|
template<> |
void | set_uniform (const std::string &name, const double &a, const double &b) |
|
template<> |
void | set_uniform (const std::string &name, const double &a, const double &b, const double &c) |
|
template<> |
void | set_uniform (const std::string &name, const double &a, const double &b, const double &c, const double &d) |
|
template<> |
void | set_uniform (const std::string &name, const Colour &a) |
|
OpenGL Shader Program.
Currently only supports vertex and fragment shaders.
Definition at line 27 of file Shader.hpp.
template<typename... Uniforms>
void galaxy::Shader::set_uniform |
( |
const std::string & | name, |
|
|
const Uniforms &... | args ) |
Specialized variadic template for setting shader uniforms.
Useful for i.e. 2f would be ("name", 1.0f, 2.0f) and 3i would be ("name", 1, 2, 3)
- Parameters
-
name | The name of the uniform to set. |
args | Variable amount of arguments for the uniform. |