summary refs log tree commit diff
path: root/src/GFX/Mesh.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/GFX/Mesh.hpp')
-rw-r--r--src/GFX/Mesh.hpp18
1 files changed, 16 insertions, 2 deletions
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 <utility>
 #include <vector>
 #include <algorithm>
+#include <optional>
+#include <GL/glew.h>
 #include "../Common/Sizes.hpp"
 #include "../Math/Common.hpp"
 
@@ -58,12 +60,24 @@ public:
         std::vector<Attribute> attributes
     ) : m_attributes(std::move(attributes)) {}
 
-    const std::vector<U32>& indices() const;
-    const std::vector<Attribute>& 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<Attribute> m_attributes;
     std::vector<U32> m_indices;
+
+    std::optional<GLuint> m_vao;
 };
 
 }
\ No newline at end of file