From 7c1dfec94391ec283e41b6b942d08dbc6bb69a3a Mon Sep 17 00:00:00 2001 From: tylermurphy534 Date: Sun, 25 Sep 2022 12:07:49 -0400 Subject: vertex data no longer hard coded --- engine/xe_model.hpp | 22 +++++----------------- 1 file changed, 5 insertions(+), 17 deletions(-) (limited to 'engine/xe_model.hpp') 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 getBindingDescriptions(); - static std::vector getAttributeDescriptions(); - - bool operator==(const Vertex &other) const { - return position == other.position && color == other.color && normal == other.normal && uv == other.uv; - } - }; - struct Builder { - std::vector vertices{}; + std::vector vertexData{}; + uint32_t vertexSize; + std::vector indices{}; void loadModel(const std::string &filepath); @@ -47,8 +35,8 @@ class Model { void draw(VkCommandBuffer commandBuffer); private: - void createVertexBuffers(const std::vector &vertices); - void createIndexBuffers(const std::vector &indices); + void createVertexBuffers(const std::vector &vertexData, uint32_t vertexSize); + void createIndexBuffers(const std::vector &indexData); Device &xeDevice; -- cgit v1.2.3-freya