OpenGLUniformWriter.ixx File
Applies prepared uniform write operations to the currently bound OpenGL program. More...
Namespaces Index
Classes Index
Description
Applies prepared uniform write operations to the currently bound OpenGL program.
File Listing
The file content with the documentation metadata removed is:
11export module helios.opengl.OpenGLUniformWriter;
13import helios.opengl.types.OpenGLUniformWriteOperation;
14import helios.engine.rendering.shader;
15import helios.math.types;
17import helios.opengl.types;
20using namespace helios::engine::rendering::shader;
21using namespace helios::engine::rendering::shader::types;
43 template<typename TUniformScope>
45 std::span<OpenGLUniformWriteOperation> operations,
46 UniformValueBag<TUniformScope>& uniformValueBag
49 for (std::size_t i = 0; i < operations.size(); ++i) {
50 auto& op = operations[i];
51 GLint location = op.location;
56 auto semantics = static_cast<UniformSemantics>(op.semantics);
58 case UniformSemantics::ViewMatrix:
59 if (uniformValueBag.template has<ViewMatrixUniform>()) {
60 glUniformMatrix4fv(location, 1, false,
61 helios::math::value_ptr(uniformValueBag.template get<ViewMatrixUniform>()));
64 case UniformSemantics::ProjectionMatrix:
65 if (uniformValueBag.template has<ProjectionMatrixUniform>()) {
66 glUniformMatrix4fv(location, 1, false,
67 helios::math::value_ptr(uniformValueBag.template get<ProjectionMatrixUniform>()));
70 case UniformSemantics::ModelMatrix:
71 if (uniformValueBag.template has<ModelMatrixUniform>()) {
72 glUniformMatrix4fv(location, 1, false,
73 helios::math::value_ptr(uniformValueBag.template get<ModelMatrixUniform>()));
76 case UniformSemantics::MaterialBaseColor:
77 if (uniformValueBag.template has<MaterialBaseColorUniform>()) {
78 glUniform4fv(location, 1,
79 helios::math::value_ptr(uniformValueBag.template get<MaterialBaseColorUniform>()));
83 assert(false && "Missing support for Uniform");
Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.9.8.