summaryrefslogtreecommitdiffhomepage
path: root/src/core.c
diff options
context:
space:
mode:
authorRay <[email protected]>2021-05-30 18:02:06 +0200
committerRay <[email protected]>2021-05-30 18:02:06 +0200
commit71995d52b36c86b09f064953fb3dd2d2fd60c704 (patch)
tree152651cd09fdecab36f3928222783d99fd1865d7 /src/core.c
parenta178a2170bb821fbee135c17fc166733caa19bda (diff)
downloadraylib-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.c28
1 files changed, 17 insertions, 11 deletions
diff --git a/src/core.c b/src/core.c
index e84d82c4..1289f54d 100644
--- a/src/core.c
+++ b/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;
}