31 lines
635 B
C
31 lines
635 B
C
#ifndef RT_VK_SWAPCHAIN_H
|
|
#define RT_VK_SWAPCHAIN_H
|
|
|
|
#include <volk/volk.h>
|
|
|
|
#include "runtime/runtime.h"
|
|
|
|
#define RT_VK_MAX_SWAPCHAIN_IMAGES 3
|
|
|
|
typedef struct {
|
|
VkSwapchainKHR swapchain;
|
|
VkImage images[RT_VK_MAX_SWAPCHAIN_IMAGES];
|
|
VkImageView image_views[RT_VK_MAX_SWAPCHAIN_IMAGES];
|
|
VkFence image_fences[RT_VK_MAX_SWAPCHAIN_IMAGES];
|
|
uint32_t image_count;
|
|
VkFormat format;
|
|
VkExtent2D extent;
|
|
} rt_swapchain;
|
|
|
|
#ifndef RT_VK_DONT_DEFINE_SWAPCHAIN_GLOBAL
|
|
extern rt_swapchain g_swapchain;
|
|
#endif
|
|
|
|
rt_result rtCreateSwapchain(void);
|
|
|
|
rt_result rtRecreateSwapchain(void);
|
|
|
|
void rtDestroySwapchain(void);
|
|
|
|
#endif
|