#pragma once #include "hk_device.hpp" // libs #define GLM_FORCE_RADIANS #define GLM_FORCE_DEPTH_ZERO_TO_ONE #include #include namespace hk{ class Model { public: struct Vertex { glm::vec3 position; glm::vec3 color; static std::vector getBindingDescriptions(); static std::vector getAttributeDescriptions(); }; struct Builder { std::vector vertices; std::vector indices; }; Model(Device &device, const Builder &builder); ~Model(); Model(const Model &) = delete; Model &operator=(const Model &) = delete; void bind(VkCommandBuffer commandBuffer); void draw(VkCommandBuffer commandBuffer); private: void createVertexBuffers(const std::vector &vertices); void createIndexBuffers(const std::vector &indices); Device &m_device; VkBuffer m_vertexBuffer; VkDeviceMemory m_vertexBufferMemory; uint32_t m_vertexCount; bool m_hasIndexBuffer = false; VkBuffer m_indexBuffer; VkDeviceMemory m_indexBufferMemory; uint32_t m_indexCount; }; }