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
This commit is contained in:
2026-05-05 21:58:34 +02:00
parent f18e5e4adc
commit 90d013695d
36 changed files with 2139 additions and 55 deletions
+29
View File
@@ -0,0 +1,29 @@
#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;
};
}