Return false from InitWindow if glfwInit or glfwCreateWindow fails

You can't do much with raylib if glfwInit or glfwCreateWindow fails,
currently it just exits by means of TraceLog(LOG_ERROR.
User code, however, might want to fall back to a text-only UI
or display a warning if raylib can't be used.
This commit is contained in:
Ahmad Fatoum
2018-02-03 12:12:50 +01:00
parent 44cd4faf83
commit 26c9176a14
2 changed files with 17 additions and 8 deletions

View File

@ -684,7 +684,7 @@ extern "C" { // Prevents name mangling of functions
//------------------------------------------------------------------------------------
// Window-related functions
RLAPI void InitWindow(int width, int height, void *data); // Initialize window and OpenGL context
RLAPI bool InitWindow(int width, int height, void *data); // Initialize window and OpenGL context
RLAPI void CloseWindow(void); // Close window and unload OpenGL context
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)