Reviewed window initialization

In case graphic device could not be created it returns false instead of
failing with an error tracelog (and consequently closing the program).
Window initialization success could be checked with new function
IsWindowReady()
This commit is contained in:
raysan5
2018-02-04 12:26:28 +01:00
parent e2861fa71f
commit 70e0070a85
2 changed files with 69 additions and 21 deletions

View File

@@ -684,8 +684,9 @@ extern "C" { // Prevents name mangling of functions
//------------------------------------------------------------------------------------
// Window-related functions
RLAPI bool InitWindow(int width, int height, void *data); // Initialize window and OpenGL context
RLAPI void InitWindow(int width, int height, void *data); // Initialize window and OpenGL context
RLAPI void CloseWindow(void); // Close window and unload OpenGL context
RLAPI bool IsWindowReady(void); // Check if window has been initialized successfully
RLAPI bool WindowShouldClose(void); // Check if KEY_ESCAPE pressed or Close icon pressed
RLAPI bool IsWindowMinimized(void); // Check if window has been minimized (or lost focus)
RLAPI void ToggleFullscreen(void); // Toggle fullscreen mode (only PLATFORM_DESKTOP)