7#include <aegis2d/render/export.hpp>
21class AEGIS2D_RENDER_EXPORT
ShaderError :
public std::runtime_error {
23 using std::runtime_error::runtime_error;
74 [[nodiscard]]
std::uint32_t
id() const noexcept;
79 [[nodiscard]]
bool has_uniform(
std::string_view name);
84 void set_uniform(
std::string_view name,
std::int32_t value);
88 void set_uniform(
std::string_view name,
float value);
92 void set_uniform(
std::string_view name,
Vec2 value);
96 void set_uniform(
std::string_view name,
Color value);
100 void set_uniform(
std::string_view name, const
Vec4& value);
104 void set_uniform(
std::string_view name, const
Mat4& matrix);
107 [[nodiscard]]
std::int32_t location(
std::string_view name);
109 std::uint32_t id_ = 0;
110 std::map<
std::
string,
std::int32_t,
std::less<>> locations_;
Thrown when a shader does not compile or a program does not link.
Definition shader.hpp:21
Vertex and fragment shaders linked into one OpenGL program.
Definition shader.hpp:44
~ShaderProgram()
Deletes the program.
ShaderProgram & operator=(ShaderProgram &&other) noexcept
Deletes this program and takes over the program of other.
ShaderProgram & operator=(const ShaderProgram &)=delete
ShaderProgram(const ShaderProgram &)=delete
ShaderProgram(const ShaderSources &sources)
Compiles both stages and links them.
ShaderProgram(ShaderProgram &&other) noexcept
Takes over the program of other, which becomes empty.
static std::string_view version_directive() noexcept
#version line prepended to every stage.
RGBA color used by the renderer.
Vector and matrix types of the engine (GLM behind engine names).
OpenGL backend of the renderer.
Definition context.hpp:18
aegis2d::Vec2 Vec2
2D vector of floats, in logical pixels: the engine-wide aegis2d::Vec2.
Definition renderer.hpp:17
glm::vec4 Vec4
4D vector of floats (glm::vec4), e.g. homogeneous positions.
Definition math.hpp:25
glm::mat4 Mat4
4x4 matrix of floats (glm::mat4), stored column by column like GLSL and HLSL constant buffers,...
Definition math.hpp:31
Definition endpoint.hpp:85
Backend-independent renderer interface and the sprite it draws.
RGBA color with components in [0, 1].
Definition color.hpp:10
GLSL sources of a program, without #version line.
Definition shader.hpp:27
std::string_view fragment
Fragment stage.
Definition shader.hpp:31
std::string_view vertex
Vertex stage.
Definition shader.hpp:29