Skip to content

Commit 2f985f2

Browse files
committed
Fixed some compiler warnings
1 parent c3f1692 commit 2f985f2

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

base/vulkanexamplebase.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ void VulkanExampleBase::renderFrame()
250250
timer -= 1.0f;
251251
}
252252
}
253-
float fpsTimer = std::chrono::duration<double, std::milli>(tEnd - lastTimestamp).count();
253+
float fpsTimer = (float)(std::chrono::duration<double, std::milli>(tEnd - lastTimestamp).count());
254254
if (fpsTimer > 1000.0f)
255255
{
256256
lastFPS = static_cast<uint32_t>((float)frameCounter * (1000.0f / fpsTimer));
@@ -621,26 +621,26 @@ void VulkanExampleBase::drawUI(const VkCommandBuffer commandBuffer)
621621
void VulkanExampleBase::prepareFrame()
622622
{
623623
// Acquire the next image from the swap chain
624-
VkResult err = swapChain.acquireNextImage(semaphores.presentComplete, &currentBuffer);
624+
VkResult result = swapChain.acquireNextImage(semaphores.presentComplete, &currentBuffer);
625625
// Recreate the swapchain if it's no longer compatible with the surface (OUT_OF_DATE) or no longer optimal for presentation (SUBOPTIMAL)
626-
if ((err == VK_ERROR_OUT_OF_DATE_KHR) || (err == VK_SUBOPTIMAL_KHR)) {
626+
if ((result == VK_ERROR_OUT_OF_DATE_KHR) || (result == VK_SUBOPTIMAL_KHR)) {
627627
windowResize();
628628
}
629629
else {
630-
VK_CHECK_RESULT(err);
630+
VK_CHECK_RESULT(result);
631631
}
632632
}
633633

634634
void VulkanExampleBase::submitFrame()
635635
{
636-
VkResult res = swapChain.queuePresent(queue, currentBuffer, semaphores.renderComplete);
637-
if (!((res == VK_SUCCESS) || (res == VK_SUBOPTIMAL_KHR))) {
638-
if (res == VK_ERROR_OUT_OF_DATE_KHR) {
636+
VkResult result = swapChain.queuePresent(queue, currentBuffer, semaphores.renderComplete);
637+
if (!((result == VK_SUCCESS) || (result == VK_SUBOPTIMAL_KHR))) {
638+
if (result == VK_ERROR_OUT_OF_DATE_KHR) {
639639
// Swap chain is no longer compatible with the surface and needs to be recreated
640640
windowResize();
641641
return;
642642
} else {
643-
VK_CHECK_RESULT(res);
643+
VK_CHECK_RESULT(result);
644644
}
645645
}
646646
VK_CHECK_RESULT(vkQueueWaitIdle(queue));

0 commit comments

Comments
 (0)