Brenta Engine 1.2
Loading...
Searching...
No Matches
ubo.hpp
1// SPDX-License-Identifier: MIT
2// Author: Giovanni Santini
3// Mail: giovanni.santini@proton.me
4// Github: @San7o
5
6#pragma once
7
8#include <brenta/renderer/opengl/shader.hpp>
9#include <brenta/renderer/opengl/buffer.hpp>
10
11namespace brenta
12{
13
14//
15// Uniform buffer objects
16// ----------------------
17//
18// These are used to set multiple uniforms with a single command
19//
20// You bind / unbind dem and write data as usual, where the data is
21// a struct with the same format as the one in the shader, which
22// can access the uniforms at the [binding_point] layout.
23class Ubo : public Buffer
24{
25public:
26
27 Ubo() : Buffer(Buffer::Target::Uniform) {}
28
29 // Initialized the UBO
30 void init(Shader& shader,
31 std::string uniform_name,
32 unsigned int binding_point,
33 size_t size);
34};
35
36} // namespace brenta