Properly terminate when the window is closed by the user
This commit is contained in:
parent
60887e54df
commit
294314112d
5
main.cpp
5
main.cpp
@ -32,6 +32,11 @@ int main() {
|
||||
App *app = app_NewApp();
|
||||
app->window = win;
|
||||
while (!app->wantQuit) {
|
||||
// Check if the window is still open
|
||||
// On Windows/MinGW, the loop stucks open when the window is closed
|
||||
if (!IsWindow(win))
|
||||
break;
|
||||
|
||||
if (time_Since(frameCounter).microseconds >= 1000000) { // 1 sec
|
||||
/* Duration d = */ time_Reset(&frameCounter);
|
||||
char buf[128];
|
||||
|
Loading…
Reference in New Issue
Block a user