diff options
author | hnOsmium0001 <[email protected]> | 2022-04-25 20:22:07 -0700 |
---|---|---|
committer | hnOsmium0001 <[email protected]> | 2022-04-25 20:22:07 -0700 |
commit | f54370de7e4214cb7813d26b1a39a8f6e42b7b56 (patch) | |
tree | 20913b4099b77af933fcd2ebb4e73f53b366ad8f /source/CpuMesh.hpp | |
parent | c8ebee643f23c34ff57f69f8dfcf1903b59ea9d1 (diff) |
Initial work on rendering sprites to screen
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); -}; |