diff options
| author | Ray <[email protected]> | 2021-05-30 18:02:06 +0200 |
|---|---|---|
| committer | Ray <[email protected]> | 2021-05-30 18:02:06 +0200 |
| commit | 71995d52b36c86b09f064953fb3dd2d2fd60c704 (patch) | |
| tree | 152651cd09fdecab36f3928222783d99fd1865d7 /src/core.c | |
| parent | a178a2170bb821fbee135c17fc166733caa19bda (diff) | |
| download | raylib-71995d52b36c86b09f064953fb3dd2d2fd60c704.tar.gz raylib-71995d52b36c86b09f064953fb3dd2d2fd60c704.zip | |
REVIEWED: exit() on LOG_FATAL instead of LOG_ERROR #1796
Diffstat (limited to 'src/core.c')
| -rw-r--r-- | src/core.c | 28 |
1 files changed, 17 insertions, 11 deletions
@@ -652,7 +652,7 @@ void InitWindow(int width, int height, const char *title) #if defined(PLATFORM_UWP) if (!UWPIsConfigured()) { - TRACELOG(LOG_ERROR, "UWP Functions have not been set yet, please set these before initializing raylib!"); + TRACELOG(LOG_FATAL, "UWP Functions have not been set yet, please set these before initializing raylib!"); return; } #endif @@ -736,7 +736,12 @@ void InitWindow(int width, int height, const char *title) // NOTE: returns true if window and graphic device has been initialized successfully CORE.Window.ready = InitGraphicsDevice(width, height); - if (!CORE.Window.ready) return; + // If graphic device is no properly initialized, we end program + if (!CORE.Window.ready) + { + TRACELOG(LOG_FATAL, "Failed to initialize Graphic Device"); + return; + } // Init hi-res timer InitTimer(); @@ -4914,6 +4919,7 @@ static void SwapBuffers(void) { gbm_surface_release_buffer(CORE.Window.gbmSurface, CORE.Window.prevBO); } + CORE.Window.prevBO = bo; #endif // PLATFORM_DRM #endif // PLATFORM_ANDROID || PLATFORM_RPI || PLATFORM_DRM || PLATFORM_UWP @@ -6268,15 +6274,15 @@ bool UWPIsConfigured() { bool pass = true; - if (uwpQueryTimeFunc == NULL) { TRACELOG(LOG_ERROR, "UWP: UWPSetQueryTimeFunc() must be called with a valid function before InitWindow()"); pass = false; } - if (uwpSleepFunc == NULL) { TRACELOG(LOG_ERROR, "UWP: UWPSetSleepFunc() must be called with a valid function before InitWindow()"); pass = false; } - if (uwpDisplaySizeFunc == NULL) { TRACELOG(LOG_ERROR, "UWP: UWPSetDisplaySizeFunc() must be called with a valid function before InitWindow()"); pass = false; } - if (uwpMouseLockFunc == NULL) { TRACELOG(LOG_ERROR, "UWP: UWPSetMouseLockFunc() must be called with a valid function before InitWindow()"); pass = false; } - if (uwpMouseUnlockFunc == NULL) { TRACELOG(LOG_ERROR, "UWP: UWPSetMouseUnlockFunc() must be called with a valid function before InitWindow()"); pass = false; } - if (uwpMouseShowFunc == NULL) { TRACELOG(LOG_ERROR, "UWP: UWPSetMouseShowFunc() must be called with a valid function before InitWindow()"); pass = false; } - if (uwpMouseHideFunc == NULL) { TRACELOG(LOG_ERROR, "UWP: UWPSetMouseHideFunc() must be called with a valid function before InitWindow()"); pass = false; } - if (uwpMouseSetPosFunc == NULL) { TRACELOG(LOG_ERROR, "UWP: UWPSetMouseSetPosFunc() must be called with a valid function before InitWindow()"); pass = false; } - if (uwpCoreWindow == NULL) { TRACELOG(LOG_ERROR, "UWP: A pointer to the UWP core window must be set before InitWindow()"); pass = false; } + if (uwpQueryTimeFunc == NULL) { TRACELOG(LOG_WARNING, "UWP: UWPSetQueryTimeFunc() must be called with a valid function before InitWindow()"); pass = false; } + if (uwpSleepFunc == NULL) { TRACELOG(LOG_WARNING, "UWP: UWPSetSleepFunc() must be called with a valid function before InitWindow()"); pass = false; } + if (uwpDisplaySizeFunc == NULL) { TRACELOG(LOG_WARNING, "UWP: UWPSetDisplaySizeFunc() must be called with a valid function before InitWindow()"); pass = false; } + if (uwpMouseLockFunc == NULL) { TRACELOG(LOG_WARNING, "UWP: UWPSetMouseLockFunc() must be called with a valid function before InitWindow()"); pass = false; } + if (uwpMouseUnlockFunc == NULL) { TRACELOG(LOG_WARNING, "UWP: UWPSetMouseUnlockFunc() must be called with a valid function before InitWindow()"); pass = false; } + if (uwpMouseShowFunc == NULL) { TRACELOG(LOG_WARNING, "UWP: UWPSetMouseShowFunc() must be called with a valid function before InitWindow()"); pass = false; } + if (uwpMouseHideFunc == NULL) { TRACELOG(LOG_WARNING, "UWP: UWPSetMouseHideFunc() must be called with a valid function before InitWindow()"); pass = false; } + if (uwpMouseSetPosFunc == NULL) { TRACELOG(LOG_WARNING, "UWP: UWPSetMouseSetPosFunc() must be called with a valid function before InitWindow()"); pass = false; } + if (uwpCoreWindow == NULL) { TRACELOG(LOG_WARNING, "UWP: A pointer to the UWP core window must be set before InitWindow()"); pass = false; } return pass; } |
