summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorRay <[email protected]>2023-10-14 12:55:31 +0200
committerRay <[email protected]>2023-10-14 12:55:31 +0200
commit54950f9a3d2df2e0f9907715d6c355133d011456 (patch)
treef1e728c3d71f0b77a254141b37d9407f2fcb3bda /src
parentb34c2ecbcb9da1d438b70acf8125ef5424744d11 (diff)
downloadraylib-54950f9a3d2df2e0f9907715d6c355133d011456.tar.gz
raylib-54950f9a3d2df2e0f9907715d6c355133d011456.zip
Make sure CORE.Window.ready is set
Diffstat (limited to 'src')
-rw-r--r--src/rcore_desktop.c2
-rw-r--r--src/rcore_drm.c2
-rw-r--r--src/rcore_web.c2
3 files changed, 6 insertions, 0 deletions
diff --git a/src/rcore_desktop.c b/src/rcore_desktop.c
index 81da488e..fe5a02aa 100644
--- a/src/rcore_desktop.c
+++ b/src/rcore_desktop.c
@@ -1657,6 +1657,8 @@ static int InitPlatform(void)
rlLoadExtensions(glfwGetProcAddress);
if ((CORE.Window.flags & FLAG_WINDOW_MINIMIZED) > 0) MinimizeWindow();
+
+ CORE.Window.ready = true; // TODO: Proper validation on windows/context creation
// If graphic device is no properly initialized, we end program
if (!CORE.Window.ready) { TRACELOG(LOG_FATAL, "PLATFORM: Failed to initialize graphic device"); return -1; }
diff --git a/src/rcore_drm.c b/src/rcore_drm.c
index 213f2c54..8f1bfa42 100644
--- a/src/rcore_drm.c
+++ b/src/rcore_drm.c
@@ -1035,6 +1035,8 @@ static int InitPlatform(void)
if ((CORE.Window.flags & FLAG_WINDOW_MINIMIZED) > 0) MinimizeWindow();
+ CORE.Window.ready = true; // TODO: Proper validation on windows/context creation
+
// If graphic device is no properly initialized, we end program
if (!CORE.Window.ready) { TRACELOG(LOG_FATAL, "PLATFORM: Failed to initialize graphic device"); return -1; }
else SetWindowPosition(GetMonitorWidth(GetCurrentMonitor()) / 2 - CORE.Window.screen.width / 2, GetMonitorHeight(GetCurrentMonitor()) / 2 - CORE.Window.screen.height / 2);
diff --git a/src/rcore_web.c b/src/rcore_web.c
index 3b9373bb..15c7626d 100644
--- a/src/rcore_web.c
+++ b/src/rcore_web.c
@@ -1002,6 +1002,8 @@ static int InitPlatform(void)
TRACELOG(LOG_INFO, " > Render size: %i x %i", CORE.Window.render.width, CORE.Window.render.height);
TRACELOG(LOG_INFO, " > Viewport offsets: %i, %i", CORE.Window.renderOffset.x, CORE.Window.renderOffset.y);
+ CORE.Window.ready = true; // TODO: Proper validation on windows/context creation
+
// If graphic device is no properly initialized, we end program
if (!CORE.Window.ready) { TRACELOG(LOG_FATAL, "PLATFORM: Failed to initialize graphic device"); return -1; }
else SetWindowPosition(GetMonitorWidth(GetCurrentMonitor())/2 - CORE.Window.screen.width/2, GetMonitorHeight(GetCurrentMonitor())/2 - CORE.Window.screen.height/2);