Moved swapchain creation into prepare function

This commit is contained in:
saschawillems 2017-10-21 16:51:39 +02:00
parent ef067b0cf7
commit 19245a0f51
3 changed files with 2 additions and 10 deletions

View file

@ -176,10 +176,10 @@ void VulkanExampleBase::createPipelineCache()
void VulkanExampleBase::prepare()
{
if (vulkanDevice->enableDebugMarkers)
{
if (vulkanDevice->enableDebugMarkers) {
vks::debugmarker::setup(device);
}
initSwapchain();
createCommandPool();
setupSwapChain();
createCommandBuffers();

View file

@ -416,7 +416,6 @@ int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE, LPSTR, int) \
vulkanExample = new VulkanExample(); \
vulkanExample->initVulkan(); \
vulkanExample->setupWindow(hInstance, WndProc); \
vulkanExample->initSwapchain(); \
vulkanExample->prepare(); \
vulkanExample->renderLoop(); \
delete(vulkanExample); \
@ -451,7 +450,6 @@ int main(const int argc, const char *argv[]) \
for (size_t i = 0; i < argc; i++) { VulkanExample::args.push_back(argv[i]); }; \
vulkanExample = new VulkanExample(); \
vulkanExample->initVulkan(); \
vulkanExample->initSwapchain(); \
vulkanExample->prepare(); \
vulkanExample->renderLoop(); \
delete(vulkanExample); \
@ -466,7 +464,6 @@ int main(const int argc, const char *argv[]) \
vulkanExample = new VulkanExample(); \
vulkanExample->initVulkan(); \
vulkanExample->setupWindow(); \
vulkanExample->initSwapchain(); \
vulkanExample->prepare(); \
vulkanExample->renderLoop(); \
delete(vulkanExample); \
@ -488,7 +485,6 @@ int main(const int argc, const char *argv[]) \
vulkanExample = new VulkanExample(); \
vulkanExample->initVulkan(); \
vulkanExample->setupWindow(); \
vulkanExample->initSwapchain(); \
vulkanExample->prepare(); \
vulkanExample->renderLoop(); \
delete(vulkanExample); \

View file

@ -1115,7 +1115,6 @@ int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR pCmdLin
vulkanExample = new VulkanExample();
vulkanExample->initVulkan();
vulkanExample->setupWindow(hInstance, WndProc);
vulkanExample->initSwapchain();
vulkanExample->prepare();
vulkanExample->renderLoop();
delete(vulkanExample);
@ -1150,7 +1149,6 @@ int main(const int argc, const char *argv[])
for (size_t i = 0; i < argc; i++) { VulkanExample::args.push_back(argv[i]); };
vulkanExample = new VulkanExample();
vulkanExample->initVulkan();
vulkanExample->initSwapchain();
vulkanExample->prepare();
vulkanExample->renderLoop();
delete(vulkanExample);
@ -1164,7 +1162,6 @@ int main(const int argc, const char *argv[])
vulkanExample = new VulkanExample();
vulkanExample->initVulkan();
vulkanExample->setupWindow();
vulkanExample->initSwapchain();
vulkanExample->prepare();
vulkanExample->renderLoop();
delete(vulkanExample);
@ -1187,7 +1184,6 @@ int main(const int argc, const char *argv[])
vulkanExample = new VulkanExample();
vulkanExample->initVulkan();
vulkanExample->setupWindow();
vulkanExample->initSwapchain();
vulkanExample->prepare();
vulkanExample->renderLoop();
delete(vulkanExample);