No fps display in window title if text overlay is enabled

This commit is contained in:
saschawillems 2016-07-24 21:18:25 +02:00
parent d414849e23
commit 706b9497ce

View file

@ -54,7 +54,11 @@ std::string VulkanExampleBase::getWindowTitle()
{ {
std::string device(deviceProperties.deviceName); std::string device(deviceProperties.deviceName);
std::string windowTitle; std::string windowTitle;
windowTitle = title + " - " + device + " - " + std::to_string(frameCounter) + " fps"; windowTitle = title + " - " + device;
if (!enableTextOverlay)
{
windowTitle += " - " + std::to_string(frameCounter) + " fps";
}
return windowTitle; return windowTitle;
} }
@ -406,9 +410,9 @@ void VulkanExampleBase::renderLoop()
fpsTimer += (float)tDiff; fpsTimer += (float)tDiff;
if (fpsTimer > 1000.0f) if (fpsTimer > 1000.0f)
{ {
std::string windowTitle = getWindowTitle();
if (!enableTextOverlay) if (!enableTextOverlay)
{ {
std::string windowTitle = getWindowTitle();
SetWindowText(window, windowTitle.c_str()); SetWindowText(window, windowTitle.c_str());
} }
lastFPS = frameCounter; lastFPS = frameCounter;