Lugdunum  0.1.0
Mesh.cpp
Go to the documentation of this file.
6 
7 namespace lug {
8 namespace Graphics {
9 namespace Vulkan {
10 namespace Render {
11 
12 Mesh::Mesh(const std::string& name) : ::lug::Graphics::Render::Mesh(name) {}
13 
15  destroy();
16 }
17 
18 void Mesh::destroy() {
19  for (auto& primitiveSet : _primitiveSets) {
20  if (!primitiveSet._data) {
21  continue;
22  }
23 
24  PrimitiveSetData* primitiveSetData = static_cast<PrimitiveSetData*>(primitiveSet._data);
25 
26  for (auto& buffer : primitiveSetData->buffers) {
27  buffer.destroy();
28  }
29 
30  delete primitiveSetData;
31  }
32 
34 }
35 
36 } // Render
37 } // Vulkan
38 } // Graphics
39 } // lug
std::vector< PrimitiveSet > _primitiveSets
Definition: Mesh.hpp:97
API::DeviceMemory _deviceMemory
Definition: Mesh.hpp:44
Class for graphics.
Definition: Graphics.hpp:25