.. _program_listing_file_Src_GraphicsEngineVulkan_scene_Mesh.hpp: Program Listing for File Mesh.hpp ================================= |exhale_lsh| :ref:`Return to documentation for file ` (``Src/GraphicsEngineVulkan/scene/Mesh.hpp``) .. |exhale_lsh| unicode:: U+021B0 .. UPWARDS ARROW WITH TIP LEFTWARDS .. code-block:: cpp #pragma once #include #include #include "ObjectDescription.hpp" #include "scene/ObjMaterial.hpp" #include "scene/Vertex.hpp" #include "vulkan_base/VulkanBufferManager.hpp" namespace Kataglyphis { // this a simple Mesh without mesh generation class Mesh { public: Mesh(VulkanDevice *device, VkQueue transfer_queue, VkCommandPool transfer_command_pool, std::vector &vertices, std::vector &indices, std::vector &materialIndex, std::vector &materials); Mesh(); void cleanUp(); ObjectDescription &getObjectDescription() { return object_description; }; glm::mat4 getModel() { return model; }; uint32_t getVertexCount() { return vertex_count; }; uint32_t getIndexCount() { return index_count; }; VkBuffer &getVertexBuffer() { return vertexBuffer.getBuffer(); }; VkBuffer &getMaterialIDBuffer() { return materialIdsBuffer.getBuffer(); }; VkBuffer &getIndexBuffer() { return indexBuffer.getBuffer(); }; void setModel(glm::mat4 new_model); ~Mesh(); private: VulkanBufferManager vulkanBufferManager; ObjectDescription object_description{ static_cast(-1), static_cast(-1), static_cast(-1), static_cast(-1) }; VulkanBuffer vertexBuffer; VulkanBuffer indexBuffer; VulkanBuffer objectDescriptionBuffer; VulkanBuffer materialIdsBuffer; VulkanBuffer materialsBuffer; glm::mat4 model; uint32_t vertex_count{ static_cast(-1) }; uint32_t index_count{ static_cast(-1) }; VulkanDevice *device{ VK_NULL_HANDLE }; void createVertexBuffer(VkQueue transfer_queue, VkCommandPool transfer_command_pool, std::vector &vertices); void createIndexBuffer(VkQueue transfer_queue, VkCommandPool transfer_command_pool, std::vector &indices); void createMaterialIDBuffer(VkQueue transfer_queue, VkCommandPool transfer_command_pool, std::vector &materialIndex); void createMaterialBuffer(VkQueue transfer_queue, VkCommandPool transfer_command_pool, std::vector &materials); }; }// namespace Kataglyphis