Updated quit procedure
This commit is contained in:
parent
15c732be38
commit
61768b00f9
@ -82,9 +82,10 @@ namespace nf {
|
|||||||
while (PeekMessage(&msg, NULL, NULL, NULL, PM_REMOVE)) {
|
while (PeekMessage(&msg, NULL, NULL, NULL, PM_REMOVE)) {
|
||||||
TranslateMessage(&msg);
|
TranslateMessage(&msg);
|
||||||
DispatchMessage(&msg);
|
DispatchMessage(&msg);
|
||||||
if (msg.message == WM_QUIT)
|
if (msg.message == WM_QUIT) {
|
||||||
m_running = false;
|
m_running = false;
|
||||||
goto FrameEnd;
|
goto FrameEnd;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
glClear(GL_COLOR_BUFFER_BIT);
|
glClear(GL_COLOR_BUFFER_BIT);
|
||||||
m_currentState->update();
|
m_currentState->update();
|
||||||
@ -94,7 +95,6 @@ namespace nf {
|
|||||||
m_frameClock = std::chrono::steady_clock::now();
|
m_frameClock = std::chrono::steady_clock::now();
|
||||||
//TODO: Update and render current state
|
//TODO: Update and render current state
|
||||||
}
|
}
|
||||||
FrameEnd:
|
|
||||||
m_fpsClock2 = std::chrono::steady_clock::now();
|
m_fpsClock2 = std::chrono::steady_clock::now();
|
||||||
m_fpsDuration = m_fpsClock2 - m_fpsClock1;
|
m_fpsDuration = m_fpsClock2 - m_fpsClock1;
|
||||||
if (m_fpsDuration.count() >= 1.0) {
|
if (m_fpsDuration.count() >= 1.0) {
|
||||||
@ -102,6 +102,7 @@ namespace nf {
|
|||||||
m_FPS = m_frames;
|
m_FPS = m_frames;
|
||||||
m_frames = 0;
|
m_frames = 0;
|
||||||
}
|
}
|
||||||
|
FrameEnd:;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user