diff options
| author | raysan5 <[email protected]> | 2018-02-04 12:31:16 +0100 |
|---|---|---|
| committer | raysan5 <[email protected]> | 2018-02-04 12:31:16 +0100 |
| commit | c32ed921a2d6ee0c5c1857f7e613ab17942b43d8 (patch) | |
| tree | b6487e478b872d0411d1cb792bd42049f14a07ca /src | |
| parent | 8f287e72d25c635df52342e9c00d417dccd33e41 (diff) | |
| download | raylib-c32ed921a2d6ee0c5c1857f7e613ab17942b43d8.tar.gz raylib-c32ed921a2d6ee0c5c1857f7e613ab17942b43d8.zip | |
Security check in case window initialization fails
Diffstat (limited to 'src')
| -rw-r--r-- | src/core.c | 13 |
1 files changed, 9 insertions, 4 deletions
@@ -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 } |
