|
JNGL
Easy to use cross-platform 2D game library
|
Linked vertex and fragment shaders. More...
#include <jngl/ShaderProgram.hpp>
Classes | |
| struct | Context |
| Lifetime object when the ShaderProgram is in use. More... | |
Public Member Functions | |
| ShaderProgram (const Shader &vertex, const Shader &fragment) | |
| ShaderProgram (const ShaderProgram &)=delete | |
| ShaderProgram (ShaderProgram &&) noexcept | |
| ShaderProgram & | operator= (const ShaderProgram &)=delete |
| ShaderProgram & | operator= (ShaderProgram &&) noexcept |
| Context | use () const |
| int | getAttribLocation (const std::string &name) const |
| int | getUniformLocation (const std::string &name) const |
| Returns the location of a uniform variable for use with Context::setUniform. | |
Linked vertex and fragment shaders.
Definition at line 17 of file ShaderProgram.hpp.
|
nodiscard |
Returns the location of a uniform variable for use with Context::setUniform.
The returned location is stable for the lifetime of the ShaderProgram and is typically queried once (e.g. in a constructor) and then cached.
| name | name of the uniform variable as declared in the GLSL source. Note that GLSL compilers strip away uniforms that aren't actually read by the shader, so this may fail even if the variable appears in the source. |
| std::runtime_error | if no active uniform with the given name exists in the linked shader program. |