Security check in case window initialization fails
This commit is contained in:
parent
8f287e72d2
commit
c32ed921a2
13
src/core.c
13
src/core.c
@ -633,14 +633,19 @@ bool IsWindowReady(void)
|
||||
bool WindowShouldClose(void)
|
||||
{
|
||||
#if defined(PLATFORM_DESKTOP) || defined(PLATFORM_WEB)
|
||||
// While window minimized, stop loop execution
|
||||
while (windowMinimized) glfwWaitEvents();
|
||||
if (windowReady)
|
||||
{
|
||||
// While window minimized, stop loop execution
|
||||
while (windowMinimized) glfwWaitEvents();
|
||||
|
||||
return (glfwWindowShouldClose(window));
|
||||
return (glfwWindowShouldClose(window));
|
||||
}
|
||||
else return true;
|
||||
#endif
|
||||
|
||||
#if defined(PLATFORM_ANDROID) || defined(PLATFORM_RPI) || defined(PLATFORM_UWP)
|
||||
return windowShouldClose;
|
||||
if (windowReady) return windowShouldClose;
|
||||
else return true;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user