diff options
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; |