diff options
author | rtk0c <[email protected]> | 2022-04-25 20:22:07 -0700 |
---|---|---|
committer | rtk0c <[email protected]> | 2022-04-25 20:22:07 -0700 |
commit | 855da86feae1a5cc14dc2d486ccf115f484dbc2e (patch) | |
tree | 8284c6a6bdfb1a919eb1a22f466f4180a329c7f3 /source/CpuMesh.hpp | |
parent | d78a55de5003dbb040f1d1c369409e63a2c806d8 (diff) |
Changeset: 16 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); -}; |