X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fbackends%2Fvulkan%2Fswapchain.h;fp=source%2Fbackends%2Fvulkan%2Fswapchain.h;h=b34b487cc03e678ba597b6edebeca0f0f26682d4;hb=99ca354f18119f82f1adeca100cd665a8f640317;hp=0000000000000000000000000000000000000000;hpb=4cd245dafe6a7ee5c93edca5aee2d146f1155309;p=libs%2Fgl.git diff --git a/source/backends/vulkan/swapchain.h b/source/backends/vulkan/swapchain.h new file mode 100644 index 00000000..b34b487c --- /dev/null +++ b/source/backends/vulkan/swapchain.h @@ -0,0 +1,40 @@ +#ifndef MSP_GL_VULKAN_SWAPCHAIN_H_ +#define MSP_GL_VULKAN_SWAPCHAIN_H_ + +#include "handles.h" +#include "swapchaintexture.h" + +namespace Msp { +namespace GL { + +class Device; +class Semaphore; + +class SwapChain +{ + friend class VulkanCommands; + +private: + Device &device; + VkSwapchain handle = 0; + VkSurface surface = 0; + unsigned width = 0; + unsigned height = 0; + std::vector images; + int current_index = -1; + +public: + SwapChain(unsigned, unsigned, unsigned); + ~SwapChain(); + + unsigned get_n_images() const { return images.size(); } + SwapChainTexture &get_image(unsigned i) { return images[i]; } + + unsigned begin_frame(Semaphore &); + void present_frame(Semaphore &); +}; + +} // namespace GL +} // namespace Msp + +#endif