diff options
author | tylermurphy534 <tylermurphy534@gmail.com> | 2022-09-25 12:07:49 -0400 |
---|---|---|
committer | tylermurphy534 <tylermurphy534@gmail.com> | 2022-09-25 12:07:49 -0400 |
commit | 7c1dfec94391ec283e41b6b942d08dbc6bb69a3a (patch) | |
tree | c97c50778aabe4ec40a0e543bf464278e434a939 /engine/xe_model.hpp | |
parent | remove Xe From engine class names (diff) | |
download | minecraftvulkan-7c1dfec94391ec283e41b6b942d08dbc6bb69a3a.tar.gz minecraftvulkan-7c1dfec94391ec283e41b6b942d08dbc6bb69a3a.tar.bz2 minecraftvulkan-7c1dfec94391ec283e41b6b942d08dbc6bb69a3a.zip |
vertex data no longer hard coded
Diffstat (limited to 'engine/xe_model.hpp')
-rw-r--r-- | engine/xe_model.hpp | 22 |
1 files changed, 5 insertions, 17 deletions
diff --git a/engine/xe_model.hpp b/engine/xe_model.hpp index fec572f..09c5913 100644 --- a/engine/xe_model.hpp +++ b/engine/xe_model.hpp @@ -14,22 +14,10 @@ namespace xe { class Model { public: - struct Vertex { - glm::vec3 position; - glm::vec3 color; - glm::vec3 normal; - glm::vec2 uv; - - static std::vector<VkVertexInputBindingDescription> getBindingDescriptions(); - static std::vector<VkVertexInputAttributeDescription> getAttributeDescriptions(); - - bool operator==(const Vertex &other) const { - return position == other.position && color == other.color && normal == other.normal && uv == other.uv; - } - }; - struct Builder { - std::vector<Vertex> vertices{}; + std::vector<float> vertexData{}; + uint32_t vertexSize; + std::vector<uint32_t> indices{}; void loadModel(const std::string &filepath); @@ -47,8 +35,8 @@ class Model { void draw(VkCommandBuffer commandBuffer); private: - void createVertexBuffers(const std::vector<Vertex> &vertices); - void createIndexBuffers(const std::vector<uint32_t> &indices); + void createVertexBuffers(const std::vector<float> &vertexData, uint32_t vertexSize); + void createIndexBuffers(const std::vector<uint32_t> &indexData); Device &xeDevice; |