6#include <brenta/renderer/opengl/ubo.hpp>
7#include <brenta/logger.hpp>
11void Ubo::init(
Shader& shader,
12 std::string uniform_name,
13 unsigned int binding_point,
17 glGetUniformBlockIndex(shader.get_id(), uniform_name.c_str());
18 if (block_index == GL_INVALID_INDEX)
20 ERROR(
"Particles::init: error settings uniform block index");
24 this->target = Buffer::Target::Uniform;
28 glUniformBlockBinding(shader.get_id(), block_index, 3);
29 glBindBufferBase(GL_UNIFORM_BUFFER, binding_point,
id);
30 glBindBufferRange(GL_UNIFORM_BUFFER, binding_point,
id, 0,
33 EVENT(Logger::Event::Lifetime,
"ubo: initialized {}", this->
id);