Lugdunum  0.1.0
View.hpp
Go to the documentation of this file.
1 #pragma once
2 
8 
9 namespace lug {
10 namespace Graphics {
11 namespace Vulkan {
12 
13 namespace API {
14 class DescriptorPool;
15 class Queue;
16 } // API
17 
18 class Renderer;
19 
20 namespace Render {
21 
23 public:
24  // TODO: Take the number of images and the list of images
25  View(Renderer& renderer, const ::lug::Graphics::Render::Target* renderTarget);
26 
27  View(const View&) = delete;
28  View(View&&) = delete;
29 
30  View& operator=(const View&) = delete;
31  View& operator=(View&&) = delete;
32 
33  ~View() = default;
34 
35  bool init(View::InitInfo& initInfo,
36  const API::Queue* presentQueue,
37  const std::vector<API::ImageView>& imageViews);
38 
39  bool render(const API::Semaphore& imageReadySemaphore, uint32_t currentImageIndex);
40  void destroy() override final;
41  bool endFrame() override final;
42 
43  Technique::Technique* getRenderTechnique();
44  const API::Semaphore& getDrawCompleteSemaphore(uint32_t currentImageIndex) const;
45 
46  VkSurfaceFormatKHR getFormat() const;
47 
48  // TODO: Add a method to change the index of the good image to use (change by the render window)
49  // TODO: Add the semaphores for the images ready in that class too
50 
51 private:
53  std::unique_ptr<Technique::Technique> _renderTechnique{nullptr};
54 
55  std::vector<API::Semaphore> _drawCompleteSemaphores;
57 
59 };
60 
62 
63 } // Render
64 } // Vulkan
65 } // Graphics
66 } // lug
#define LUG_GRAPHICS_API
Definition: Export.hpp:11
std::vector< API::Semaphore > _drawCompleteSemaphores
Definition: View.hpp:55
const API::Queue * _presentQueue
Definition: View.hpp:56