diff options
| author | Mel <einebeere@gmail.com> | 2022-10-01 16:59:29 +0200 |
|---|---|---|
| committer | Mel <einebeere@gmail.com> | 2022-10-01 16:59:29 +0200 |
| commit | aca1326e7e3cc4c06e29b92dca256673b46aa510 (patch) | |
| tree | c7cb614990afa3140700448ab1c89091e1f6e347 /src/Binder.hpp | |
| parent | e2234b4afebb266878435d10267e7b162b1fe984 (diff) | |
| download | meowcraft-aca1326e7e3cc4c06e29b92dca256673b46aa510.tar.zst meowcraft-aca1326e7e3cc4c06e29b92dca256673b46aa510.zip | |
Triangle
Diffstat (limited to 'src/Binder.hpp')
| -rw-r--r-- | src/Binder.hpp | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/src/Binder.hpp b/src/Binder.hpp new file mode 100644 index 0000000..721ec77 --- /dev/null +++ b/src/Binder.hpp @@ -0,0 +1,37 @@ +#pragma once + +#include <cstdint> +#include "Mesh.hpp" + +namespace MC { + +class BindableMesh { +public: + void bind() const; + void unbind(); + + size_t size() const; + +private: + BindableMesh(uint32_t vao, size_t vertex_count) : m_vao(vao), m_vertex_count(vertex_count) {}; + + uint32_t m_vao; + size_t m_vertex_count; + + friend class Binder; +}; + +class Binder { +public: + Binder() = default;; + + static BindableMesh load(Mesh& mesh); + +private: + static uint32_t create_vao(); + static uint32_t unbind_vao(); + + static void store_in_attribute_list(uint32_t attribute, size_t size, float* data, size_t data_size); +}; + +} \ No newline at end of file |
