From 6b69d4b5b648253f894707723af0e2eae9f71445 Mon Sep 17 00:00:00 2001 From: Mel Date: Sat, 29 Jul 2023 03:31:42 +0200 Subject: Move chunk reification to worker threads and set stage for chunk-unbound lighting --- src/GFX/Mesh.hpp | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'src/GFX/Mesh.hpp') diff --git a/src/GFX/Mesh.hpp b/src/GFX/Mesh.hpp index 69625ff..435afe1 100644 --- a/src/GFX/Mesh.hpp +++ b/src/GFX/Mesh.hpp @@ -3,6 +3,8 @@ #include #include #include +#include +#include #include "../Common/Sizes.hpp" #include "../Math/Common.hpp" @@ -58,12 +60,24 @@ public: std::vector attributes ) : m_attributes(std::move(attributes)) {} - const std::vector& indices() const; - const std::vector& attributes() const; + USize size() const; + + void bind(); + void unbind() const; private: + void upload(); + + static GLuint create_vao(); + static void unbind_vao(); + + static void store_in_attribute_list(U32 attribute, Int attribute_size, Int type_size, const void* data, long data_size); + static void store_indices(const U32* indices, USize indices_size); + std::vector m_attributes; std::vector m_indices; + + std::optional m_vao; }; } \ No newline at end of file -- cgit 1.4.1