]> git.tdb.fi Git - libs/gl.git/blob - source/backends/vulkan/windowview_backend.h
InstanceArray doesn't need to refresh the vertex arrays
[libs/gl.git] / source / backends / vulkan / windowview_backend.h
1 #ifndef MSP_GL_WINDOWVIEW_BACKEND_H_
2 #define MSP_GL_WINDOWVIEW_BACKEND_H_
3
4 #include "device.h"
5 #include "framebuffer.h"
6 #include "semaphore.h"
7 #include "swapchain.h"
8 #include "view.h"
9
10 namespace Msp {
11 namespace GL {
12
13 class VulkanWindowView: public View
14 {
15 protected:
16         SwapChain *swap_chain = 0;
17         std::vector<Framebuffer> framebuffers;
18         Framebuffer *current_target = 0;
19         Semaphore semaphores[MAX_FRAMES_IN_FLIGHT*2];
20         unsigned frame_index = 0;
21
22         VulkanWindowView() = default;
23         ~VulkanWindowView();
24
25         virtual void render();
26         virtual const Framebuffer &get_target() const { return *current_target; }
27
28         void resize_framebuffer(unsigned, unsigned);
29 };
30
31 using WindowViewBackend = VulkanWindowView;
32
33 } // namespace GL
34 } // namespace Msp
35
36 #endif