90d013695d
- 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
30 lines
576 B
C++
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;
|
|
};
|
|
|
|
}
|