Lugdunum  0.1.0
CommandBuffer.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 CommandBuffer;
13 } // Builder
14 
15 class Buffer;
16 class CommandPool;
17 class DescriptorSet;
18 class Framebuffer;
19 class GraphicsPipeline;
20 class Image;
21 class PipelineLayout;
22 class RenderPass;
23 
25  friend class Builder::CommandBuffer;
26 
27 public:
28  CommandBuffer() = default;
29 
30  CommandBuffer(const CommandBuffer&) = delete;
32 
33  CommandBuffer& operator=(const CommandBuffer&) = delete;
35 
36  ~CommandBuffer();
37 
38  explicit operator VkCommandBuffer() const {
39  return _commandBuffer;
40  }
41 
42  const CommandPool* getCommandPool() const;
43 
44  // Add begin, end, etc
45  bool begin(VkCommandBufferUsageFlags flags = VK_COMMAND_BUFFER_USAGE_ONE_TIME_SUBMIT_BIT) const;
46  bool end() const;
47 
53 
54  bool reset(bool releaseRessources = false) const;
55  void destroy();
56 
57 private:
58  explicit CommandBuffer(VkCommandBuffer commandBuffer, const CommandPool* commandPool);
59 
60 private:
61  VkCommandBuffer _commandBuffer{VK_NULL_HANDLE};
62 
63  const CommandPool* _commandPool{nullptr};
64 };
65 
67 
68 } // API
69 } // Vulkan
70 } // Graphics
71 } // lug
#define LUG_GRAPHICS_API
Definition: Export.hpp:11