TerraForge3D  2.3.1
3D Terrain And Landscape Generator

◆ OnOneSecondTick()

virtual void MyApp::OnOneSecondTick ( )
inlineoverridevirtual

Reimplemented from Application.

Definition at line 838 of file Main.cpp.

839 {
840 if (!appState->states.ruinning)
841 {
842 return;
843 }
844
845 appState->globals.secondCounter++;
846
847 if (appState->globals.secondCounter % 5 == 0)
848 {
849 if (appState->states.autoSave)
850 {
851 SaveFile(appState->constants.cacheDir + PATH_SEPARATOR "autosave" PATH_SEPARATOR "autosave.terr3d");
852
853 if (appState->globals.currentOpenFilePath.size() > 3)
854 {
855 SaveFile(appState->globals.currentOpenFilePath);
856 }
857 }
858 }
859
860 GetWindow()->SetVSync(appState->states.vSync);
861 appState->stats.frameRate = 1 / appState->stats.deltatime;
862 }