Files
cuber/cbt/opengl/descriptor.hpp
T
portersky 90d013695d feat: add OpenGL abstraction layer with RAII resources
- Replace window class with cbt::opengl::context
- Add buffer resource (VBO, EBO, UBO, SSBO) with move semantics
- Add texture resource with format/type enums and filtering
- Add descriptor_set for Vulkan-style resource binding
- All resources use RAII with proper cleanup
2026-05-05 21:58:34 +02:00

30 lines
576 B
C++

#pragma once
#include "cbt/opengl/buffer.hpp"
#include "cbt/opengl/texture.hpp"
#include <array>
#include <optional>
#include <vector>
namespace cbt::opengl {
struct descriptor_binding {
GLuint texture_unit = 0;
std::optional<texture> tex;
std::optional<buffer> buf;
};
class descriptor_set {
std::vector<descriptor_binding> m_bindings;
public:
descriptor_set();
auto add_texture(texture tex, GLuint unit = 0) -> void;
auto add_buffer(buffer buf, GLuint unit = 0) -> void;
auto bind_all() -> void;
auto count() const -> size_t;
};
}