diff options
author | hnOsmium0001 <[email protected]> | 2022-04-08 22:30:12 -0700 |
---|---|---|
committer | hnOsmium0001 <[email protected]> | 2022-04-08 22:30:12 -0700 |
commit | e47a98793e58a5dbbe76bfed27e59408e43538e4 (patch) | |
tree | 250eb4c4200efb63c493ac6f4adb83c89be10ea1 /source/CpuMesh.hpp | |
parent | 3fdc6eb4f2cbeffce9b250beec4d3a2d52a3f534 (diff) |
More work
Diffstat (limited to 'source/CpuMesh.hpp')
-rw-r--r-- | source/CpuMesh.hpp | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/source/CpuMesh.hpp b/source/CpuMesh.hpp new file mode 100644 index 0000000..7c6e2c8 --- /dev/null +++ b/source/CpuMesh.hpp @@ -0,0 +1,28 @@ +#pragma once + +#include "Mesh.hpp" +#include "RcPtr.hpp" + +#include <cstddef> +#include <memory> + +class CpuMesh : public RefCounted { +private: + std::unique_ptr<std::byte[]> mVertexData; + std::unique_ptr<std::byte[]> mIndexData; + RcPtr<GpuMesh> mGpuMesh; + RcPtr<VertexFormat> mVertexFormat; + Tags::IndexType mIndexType; + int mVertexByteCount; + int mIndexCount; + +public: + bool IsEmpty() const; + std::byte* GetVertices() const; + int GetVertexNumBytes() const; + std::byte* GetIndices() const; + int GetIndexNumBytes() const; + + GpuMesh* SyncToGpuCreate() const; + void SyncToGpu(GpuMesh& mesh) const; +}; |