From 61768b00f9279d5c79e0d872abbeba09f9c81332 Mon Sep 17 00:00:00 2001 From: "Grayson Riffe (Desktop)" Date: Wed, 18 Aug 2021 21:32:55 -0500 Subject: [PATCH] Updated quit procedure --- NothinFancy/src/Application.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/NothinFancy/src/Application.cpp b/NothinFancy/src/Application.cpp index 73860f5..79731f3 100644 --- a/NothinFancy/src/Application.cpp +++ b/NothinFancy/src/Application.cpp @@ -82,9 +82,10 @@ namespace nf { while (PeekMessage(&msg, NULL, NULL, NULL, PM_REMOVE)) { TranslateMessage(&msg); DispatchMessage(&msg); - if (msg.message == WM_QUIT) + if (msg.message == WM_QUIT) { m_running = false; - goto FrameEnd; + goto FrameEnd; + } } glClear(GL_COLOR_BUFFER_BIT); m_currentState->update(); @@ -94,7 +95,6 @@ namespace nf { m_frameClock = std::chrono::steady_clock::now(); //TODO: Update and render current state } - FrameEnd: m_fpsClock2 = std::chrono::steady_clock::now(); m_fpsDuration = m_fpsClock2 - m_fpsClock1; if (m_fpsDuration.count() >= 1.0) { @@ -102,6 +102,7 @@ namespace nf { m_FPS = m_frames; m_frames = 0; } + FrameEnd:; } }