summaryrefslogtreecommitdiffstats
path: root/NativeApp/src/Win32/WinMain.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'NativeApp/src/Win32/WinMain.cpp')
-rw-r--r--NativeApp/src/Win32/WinMain.cpp21
1 files changed, 12 insertions, 9 deletions
diff --git a/NativeApp/src/Win32/WinMain.cpp b/NativeApp/src/Win32/WinMain.cpp
index 62b206f..a5a3f76 100644
--- a/NativeApp/src/Win32/WinMain.cpp
+++ b/NativeApp/src/Win32/WinMain.cpp
@@ -124,18 +124,21 @@ int WINAPI WinMain(HINSTANCE instance, HINSTANCE, LPSTR, int cmdShow)
auto ElapsedTime = CurrTime - PrevTime;
PrevTime = CurrTime;
- g_pTheApp->Update(CurrTime, ElapsedTime);
+ if (g_pTheApp->IsReady())
+ {
+ g_pTheApp->Update(CurrTime, ElapsedTime);
- g_pTheApp->Render();
+ g_pTheApp->Render();
- g_pTheApp->Present();
+ g_pTheApp->Present();
- double filterScale = 0.2;
- filteredFrameTime = filteredFrameTime * (1.0 - filterScale) + filterScale * ElapsedTime;
- std::stringstream fpsCounterSS;
- fpsCounterSS << AppTitle << " - " << std::fixed << std::setprecision(1) << filteredFrameTime * 1000;
- fpsCounterSS << " ms (" << 1.0 / filteredFrameTime << " fps)";
- SetWindowTextA(wnd, fpsCounterSS.str().c_str());
+ double filterScale = 0.2;
+ filteredFrameTime = filteredFrameTime * (1.0 - filterScale) + filterScale * ElapsedTime;
+ std::stringstream fpsCounterSS;
+ fpsCounterSS << AppTitle << " - " << std::fixed << std::setprecision(1) << filteredFrameTime * 1000;
+ fpsCounterSS << " ms (" << 1.0 / filteredFrameTime << " fps)";
+ SetWindowTextA(wnd, fpsCounterSS.str().c_str());
+ }
}
}