diff options
Diffstat (limited to 'source/CpuMesh.hpp')
-rw-r--r-- | source/CpuMesh.hpp | 51 |
1 files changed, 0 insertions, 51 deletions
diff --git a/source/CpuMesh.hpp b/source/CpuMesh.hpp deleted file mode 100644 index 9fcb00c..0000000 --- a/source/CpuMesh.hpp +++ /dev/null @@ -1,51 +0,0 @@ -#pragma once - -#include "Color.hpp" -#include "Mesh.hpp" -#include "PodVector.hpp" -#include "RcPtr.hpp" - -#include <cstddef> -#include <cstdint> -#include <glm/glm.hpp> -#include <memory> - -struct StandardVertex { - float x, y, z; - float u, v; - uint8_t r, g, b, a; -}; - -struct StandardVertexExtra { - float u, v; - uint8_t r, g, b, a; -}; - -class StandardCpuMeshData { -public: - PodVector<glm::vec3> vertPositions; - PodVector<StandardVertexExtra> vertExtra; - PodVector<uint32_t> index; - size_t vertexCount; - size_t triangleCount; -}; - -class StandardCpuMesh { -private: - StandardCpuMeshData* mData = nullptr; - RcPtr<GpuMesh> mGpuMesh; - -public: - StandardCpuMesh(); - ~StandardCpuMesh(); - - GpuVertexBuffer* GetPosBuffer() const; - GpuVertexBuffer* GetExtraBuffer() const; - GpuMesh* GetGpuMesh() const { return mGpuMesh.Get(); } - - void CreateCpuData(); - bool UpdatePositions(glm::vec3* pos, size_t count, size_t startVertIndex); - bool UpdateColors(RgbaColor* color, size_t count, size_t starVertIndex); - bool UpdateNormals(glm::vec2* normals, size_t count, size_t startVertIndex); - bool UpdateIndices(uint32_t* indices, size_t count, size_t startVertIndex); -}; |