Lugdunum  0.1.0
CommandBuffer.hpp
Go to the documentation of this file.
1 #pragma once
2 
3 #include <memory>
4 #include <vector>
5 
7 
8 namespace lug {
9 namespace Graphics {
10 namespace Vulkan {
11 namespace API {
12 
13 class CommandPool;
14 class Device;
15 
16 namespace Builder {
17 
19 public:
20  CommandBuffer(const API::Device& device, const API::CommandPool& commandPool);
21 
22  CommandBuffer(const CommandBuffer&) = delete;
23  CommandBuffer(CommandBuffer&&) = delete;
24 
25  CommandBuffer& operator=(const CommandBuffer&) = delete;
27 
28  ~CommandBuffer() = default;
29 
30  // Setters
31  void setLevel(VkCommandBufferLevel level);
32 
33  // Build methods
34  bool build(API::CommandBuffer& instance, VkResult* returnResult = nullptr);
35  std::unique_ptr<API::CommandBuffer> build(VkResult* returnResult = nullptr);
36 
37  bool build(std::vector<API::CommandBuffer>& commandBuffers, VkResult* returnResult = nullptr);
38  std::vector<std::unique_ptr<API::CommandBuffer>> build(uint32_t count, VkResult* returnResult = nullptr);
39 
40 private:
42 
44  VkCommandBufferLevel _level{VK_COMMAND_BUFFER_LEVEL_PRIMARY};
45 };
46 
48 
49 } // Builder
50 } // API
51 } // Vulkan
52 } // Graphics
53 } // lug
bool build(API::CommandBuffer &instance, VkResult *returnResult=nullptr)
void setLevel(VkCommandBufferLevel level)
CommandBuffer(const API::Device &device, const API::CommandPool &commandPool)
CommandBuffer & operator=(const CommandBuffer &)=delete