Examples: Vulkan: Fixed tabs->space, removed extraneous braces and empty lines. (#2071)

This commit is contained in:
omar 2018-09-11 22:18:24 +02:00
parent b88a3b2711
commit c7eef99a33
4 changed files with 91 additions and 107 deletions

View File

@ -307,11 +307,6 @@ static void RebuildSwapChain(int width, int height)
g_PendingSwapchainRebuild = false;
}
static void RebuildSwapChain()
{
RebuildSwapChain(g_WindowData.Width, g_WindowData.Height);
}
int main(int, char**)
{
// Setup SDL
@ -443,7 +438,7 @@ int main(int, char**)
}
if (g_PendingSwapchainRebuild)
RebuildSwapChain();
RebuildSwapChain(g_WindowData.Width, g_WindowData.Height);
// Start the Dear ImGui frame
ImGui_ImplVulkan_NewFrame();

View File

@ -773,9 +773,7 @@ bool ImGui_ImplVulkan_Init(ImGui_ImplVulkan_InitInfo* info, VkRenderPass rend
g_CheckVkResultFn = info->CheckVkResultFn;
g_FramesDataBuffers.resize(info->QueuedFrames);
for (int i = 0; i < g_FramesDataBuffers.size(); i++)
{
g_FramesDataBuffers[i] = FrameDataForRender();
}
ImGui_ImplVulkan_CreateDeviceObjects();
@ -795,18 +793,13 @@ void ImGui_ImplVulkan_NewFrame()
void ImGui_ImplVulkan_SetQueuedFramesCount(uint32_t count)
{
if (count == g_FramesDataBuffers.size())
{
return;
}
ImGui_ImplVulkan_InvalidateFrameDeviceObjects();
uint32_t old_size = g_FramesDataBuffers.size();
g_FramesDataBuffers.resize(count);
for (uint32_t i = old_size; i < count; i++)
{
g_FramesDataBuffers[i] = FrameDataForRender();
}
g_FrameIndex = 0;
}
@ -1043,16 +1036,12 @@ void ImGui_ImplVulkanH_CreateWindowDataSwapChainAndFramebuffer(VkPhysicalDevice
check_vk_result(err);
for (uint32_t i = 0; i < wd->Frames.size(); i++)
{
ImGui_ImplVulkanH_DestroyFrameData(g_Instance, device, &wd->Frames[i], allocator);
}
uint32_t old_size = wd->Frames.size();
wd->Frames.resize(wd->BackBufferCount);
for (uint32_t i = 0; i < wd->Frames.size(); i++)
{
wd->Frames[i] = ImGui_ImplVulkanH_FrameData();
}
}
if (old_swapchain)
vkDestroySwapchainKHR(device, old_swapchain, allocator);