Lugdunum  0.1.0
Fence.hpp
Go to the documentation of this file.
1 #pragma once
2 
5 
6 namespace lug {
7 namespace Graphics {
8 namespace Vulkan {
9 namespace API {
10 
11 namespace Builder {
12 class Fence;
13 } // Builder
14 
15 class Device;
16 
18  friend class Builder::Fence;
19 
20 public:
21  Fence() = default;
22 
23  Fence(const Fence&) = delete;
24  Fence(Fence&& fence);
25 
26  Fence& operator=(const Fence&) = delete;
27  Fence& operator=(Fence&& fence);
28 
29  ~Fence();
30 
31  explicit operator VkFence() const {
32  return _fence;
33  }
34 
35  VkResult getStatus() const;
36  bool reset() const;
37  bool wait() const;
38 
39  void destroy();
40 
41 private:
42  explicit Fence(VkFence fence, const Device* device);
43 
44 private:
45  VkFence _fence{VK_NULL_HANDLE};
46  const Device* _device{nullptr};
47 };
48 
49 } // API
50 } // Vulkan
51 } // Graphics
52 } // lug
#define LUG_GRAPHICS_API
Definition: Export.hpp:11