starting swapchain implementation

This commit is contained in:
2023-03-02 14:36:23 +01:00
parent 63989790d2
commit e299d56058
2 changed files with 17 additions and 0 deletions

16
kvf.h
View File

@@ -83,6 +83,9 @@ void kvfDestroyFence(VkDevice device, VkFence fence);
VkSemaphore kvfCreateSemaphore(VkDevice device);
void kvfDestroySemaphore(VkDevice device, VkSemaphore semaphore);
VkSwapchainKHR kvfCreateSwapchain(VkDevice device, VkPhysicalDevice physical, VkSurfaceKHR surface);
void kvfDestroySwapchain(VkDevice device, VkSwapchainKHR swapchain);
#ifdef __cplusplus
}
#endif
@@ -457,6 +460,19 @@ void kvfDestroySemaphore(VkDevice device, VkSemaphore semaphore)
vkDestroySemaphore(device, semaphores, NULL);
}
VkSwapchainKHR kvfCreateSwapchain(VkDevice device, VkPhysicalDevice physical, VkSurfaceKHR surface)
{
}
void kvfDestroySwapchain(VkDevice device, VkSwapchainKHR swapchain)
{
if(swapchain == VK_NULL_HANDLE)
return;
KVF_ASSERT(device != VK_NULL_HANDLE);
vkDestroySwapchainKHR(device, swapchain, NULL);
}
#endif // KVF_IMPLEMENTATION
#endif // KBZ_8_VULKAN_FRAMEWORK_H

View File

@@ -21,6 +21,7 @@ int main(void)
VkDevice device = kvfCreateDefaultDevice(ph_device);
VkQueue graphics_queue = kvfGetDeviceQueue(device, KVF_GRAPHICS_QUEUE);
VkQueue present_queue = kvfGetDeviceQueue(device, KVF_PRESENT_QUEUE);
VkSwapchainKHR swapchain = kvfCreateSwapchain(device, ph_device, surface);
SDL_Delay(2000);