adding swapchain support
This commit is contained in:
@@ -15,16 +15,24 @@ int main(void)
|
||||
SDL_Vulkan_GetInstanceExtensions(win, &ext_count, exts + 1);
|
||||
|
||||
VkInstance instance = kvfCreateInstance(exts, ext_count + 1);
|
||||
|
||||
VkSurfaceKHR surface = VK_NULL_HANDLE;
|
||||
SDL_Vulkan_CreateSurface(win, instance, &surface);
|
||||
|
||||
VkPhysicalDevice ph_device = kvfPickGoodDefaultPhysicalDevice(instance, surface);
|
||||
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);
|
||||
|
||||
int width, height;
|
||||
SDL_Vulkan_GetDrawableSize(win, &width, &height);
|
||||
VkExtent2D actualExtent = { width, height };
|
||||
VkSwapchainKHR swapchain = kvfCreateSwapchainKHR(device, ph_device, surface, extend, true);
|
||||
|
||||
SDL_Delay(2000);
|
||||
|
||||
kvfDestroySwapchainKHR(device, swapchain);
|
||||
vkDestroySurfaceKHR(instance, surface, NULL);
|
||||
kvfDestroyDevice(device);
|
||||
kvfDestroyInstance(instance);
|
||||
|
||||
Reference in New Issue
Block a user