SwapChain function naming

This commit is contained in:
saschawillems 2016-02-23 21:55:37 +01:00
parent fb41887c9d
commit 0c5705f2e9
2 changed files with 7 additions and 6 deletions

View file

@ -1025,15 +1025,15 @@ void VulkanExampleBase::setupRenderPass()
void VulkanExampleBase::initSwapchain() void VulkanExampleBase::initSwapchain()
{ {
#ifdef _WIN32 #ifdef _WIN32
swapChain.initSwapChain(windowInstance, window); swapChain.initSurface(windowInstance, window);
#else #else
swapChain.initSwapChain(connection, window); swapChain.initSurface(connection, window);
#endif #endif
} }
void VulkanExampleBase::setupSwapChain() void VulkanExampleBase::setupSwapChain()
{ {
swapChain.setup(setupCmdBuffer, &width, &height); swapChain.create(setupCmdBuffer, &width, &height);
} }

View file

@ -88,7 +88,7 @@ public:
// Creates an os specific surface // Creates an os specific surface
// Tries to find a graphics and a present queue // Tries to find a graphics and a present queue
void initSwapChain( void initSurface(
#ifdef _WIN32 #ifdef _WIN32
void* platformHandle, void* platformWindow void* platformHandle, void* platformWindow
#else #else
@ -234,8 +234,8 @@ public:
GET_DEVICE_PROC_ADDR(device, QueuePresentKHR); GET_DEVICE_PROC_ADDR(device, QueuePresentKHR);
} }
// Create the swap chain images with given width and height // Create the swap chain and get images with given width and height
void setup(VkCommandBuffer cmdBuffer, uint32_t *width, uint32_t *height) void create(VkCommandBuffer cmdBuffer, uint32_t *width, uint32_t *height)
{ {
VkResult err; VkResult err;
VkSwapchainKHR oldSwapchain = swapChain; VkSwapchainKHR oldSwapchain = swapChain;
@ -397,6 +397,7 @@ public:
return fpQueuePresentKHR(queue, &presentInfo); return fpQueuePresentKHR(queue, &presentInfo);
} }
// Free all Vulkan resources used by the swap chain
void cleanup() void cleanup()
{ {
for (uint32_t i = 0; i < imageCount; i++) for (uint32_t i = 0; i < imageCount; i++)