mirror of
https://github.com/raysan5/raylib.git
synced 2025-09-25 04:28:30 +00:00
REVIEWED: exit() on LOG_FATAL instead of LOG_ERROR #1796
This commit is contained in:
28
src/core.c
28
src/core.c
@@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user