Lugdunum  0.1.0
Device.hpp
Go to the documentation of this file.
1 #pragma once
2 
6 
7 namespace lug {
8 namespace Graphics {
9 namespace Vulkan {
10 namespace API {
11 
12 namespace Builder {
13 class Device;
14 } // Builder
15 
17  friend class Builder::Device;
18 
19 public:
20  Device() = default;
21 
22  Device(const Device&) = delete;
23  Device(Device&& device);
24 
25  Device& operator=(const Device&) = delete;
26  Device& operator=(Device&& device);
27 
28  ~Device();
29 
30  explicit operator VkDevice() const {
31  return _device;
32  }
33 
34  template <typename Function>
35  Function getProcAddr(const char* name) const;
36 
37  const PhysicalDeviceInfo* getPhysicalDeviceInfo() const;
38 
39  const std::vector<QueueFamily>& getQueueFamilies() const;
40  std::vector<QueueFamily>& getQueueFamilies();
41 
42  const API::QueueFamily* getQueueFamily(VkQueueFlags flags, bool supportPresentation = false) const;
43  API::QueueFamily* getQueueFamily(VkQueueFlags flags, bool supportPresentation = false);
44  const API::Queue* getQueue(const std::string& queueName) const;
45 
46  bool waitIdle() const;
47 
48  void destroy();
49 
50 
51 private:
52  explicit Device(VkDevice device, const PhysicalDeviceInfo* physicalDeviceInfo);
53 
54 private:
55  VkDevice _device{VK_NULL_HANDLE};
56 
57  const PhysicalDeviceInfo* _physicalDeviceInfo{nullptr};
58  std::vector<QueueFamily> _queueFamilies;
59 };
60 
62 
63 } // API
64 } // Vulkan
65 } // Graphics
66 } // lug
#define LUG_GRAPHICS_API
Definition: Export.hpp:11
std::vector< QueueFamily > _queueFamilies
Definition: Device.hpp:58