Move WindowShouldClose out of rcore
This commit is contained in:
parent
cc5249b82c
commit
2125da5926
1 changed files with 51 additions and 35 deletions
|
|
@ -500,4 +500,24 @@ void CloseWindow(void)
|
|||
|
||||
CORE.Window.ready = false;
|
||||
TRACELOG(LOG_INFO, "Window closed successfully");
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Check if KEY_ESCAPE pressed or Close icon pressed
|
||||
bool WindowShouldClose(void)
|
||||
{
|
||||
if (CORE.Window.ready)
|
||||
{
|
||||
// While window minimized, stop loop execution
|
||||
while (IsWindowState(FLAG_WINDOW_MINIMIZED) && !IsWindowState(FLAG_WINDOW_ALWAYS_RUN)) glfwWaitEvents();
|
||||
|
||||
CORE.Window.shouldClose = glfwWindowShouldClose(CORE.Window.handle);
|
||||
|
||||
// Reset close status for next frame
|
||||
glfwSetWindowShouldClose(CORE.Window.handle, GLFW_FALSE);
|
||||
|
||||
return CORE.Window.shouldClose;
|
||||
}
|
||||
else return true;
|
||||
}
|
||||
Loading…
Reference in a new issue