b6adb7c23a
- Reorder all class headers to put public interface before private members - Document convention in AGENTS.md
31 lines
585 B
C++
31 lines
585 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 {
|
|
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;
|
|
|
|
private:
|
|
std::vector<descriptor_binding> m_bindings;
|
|
};
|
|
|
|
}
|