summary refs log tree commit diff
path: root/src/GFX/Mesh.hpp
diff options
context:
space:
mode:
authorMel <einebeere@gmail.com>2023-07-08 03:25:44 +0200
committerMel <einebeere@gmail.com>2023-07-08 03:25:44 +0200
commitfe2baedc760c2f29e2c720f6b1132a2de33c5430 (patch)
treedfbe1c72a17805a3cab6e0d47433e9021890c9ca /src/GFX/Mesh.hpp
parent41fbca10f6c6cdd9c1623f1347e7ecb40f5e7f59 (diff)
downloadmeowcraft-fe2baedc760c2f29e2c720f6b1132a2de33c5430.tar.zst
meowcraft-fe2baedc760c2f29e2c720f6b1132a2de33c5430.zip
Use own size types
Diffstat (limited to 'src/GFX/Mesh.hpp')
-rw-r--r--src/GFX/Mesh.hpp22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/GFX/Mesh.hpp b/src/GFX/Mesh.hpp
index ec21e53..1c39941 100644
--- a/src/GFX/Mesh.hpp
+++ b/src/GFX/Mesh.hpp
@@ -2,7 +2,7 @@
 
 #include <utility>
 #include <vector>
-#include <cstdint>
+#include "../Common/Sizes.hpp"
 #include "../Math/Common.hpp"
 
 namespace MC::GFX {
@@ -10,7 +10,7 @@ namespace MC::GFX {
 class Mesh {
 public:
     struct Attribute {
-        template<size_t S = 3, typename T = float>
+        template<uint S = 3, typename T = float>
         Attribute(
             std::vector<Vector<S, T>> v
         ) : data_size(v.size()),
@@ -26,21 +26,21 @@ public:
             attribute_size(other.attribute_size),
             type_size(other.type_size) {}
 
-        static void* copy(void* ptr, uint32_t size) {
-            auto* buffer = new uint8_t[size];
-            std::copy_n((uint8_t*)ptr, size, buffer);
+        static void* copy(void* ptr, U32 size) {
+            auto* buffer = new U8[size];
+            std::copy_n((U8*)ptr, size, buffer);
             return buffer;
         }
 
         void* data;
-        long data_size;
-        int attribute_size;
-        int type_size;
+        USize data_size;
+        USize attribute_size;
+        USize type_size;
     };
 
     Mesh(
         std::vector<Attribute> attributes,
-        std::vector<uint32_t> indices
+        std::vector<U32> indices
     ) : m_attributes(std::move(attributes)),
         m_indices(std::move(indices)) {}
 
@@ -48,12 +48,12 @@ public:
         std::vector<Attribute> attributes
     ) : m_attributes(std::move(attributes)) {}
 
-    const std::vector<uint32_t>& indices() const;
+    const std::vector<U32>& indices() const;
     const std::vector<Attribute>& attributes() const;
 
 private:
     std::vector<Attribute> m_attributes;
-    std::vector<uint32_t> m_indices;
+    std::vector<U32> m_indices;
 };
 
 }
\ No newline at end of file