diff --git a/src/platforms/rcore_desktop_glfw.c b/src/platforms/rcore_desktop_glfw.c index ca7756627..239df0657 100644 --- a/src/platforms/rcore_desktop_glfw.c +++ b/src/platforms/rcore_desktop_glfw.c @@ -307,6 +307,8 @@ void RestoreWindow(void) // Set window configuration state using flags void SetWindowState(unsigned int flags) { + if (!CORE.Window.ready) TRACELOG(LOG_WARNING, "WINDOW: SetWindowState does nothing before window initialization, Use \"SetConfigFlags\" instead"); + // Check previous state and requested state to apply required changes // NOTE: In most cases the functions already change the flags internally diff --git a/src/platforms/rcore_desktop_rgfw.c b/src/platforms/rcore_desktop_rgfw.c index 9a5841c83..92e3def05 100644 --- a/src/platforms/rcore_desktop_rgfw.c +++ b/src/platforms/rcore_desktop_rgfw.c @@ -350,6 +350,8 @@ void RestoreWindow(void) // Set window configuration state using flags void SetWindowState(unsigned int flags) { + if (!CORE.Window.ready) TRACELOG(LOG_WARNING, "WINDOW: SetWindowState does nothing before window initialization, Use \"SetConfigFlags\" instead"); + CORE.Window.flags |= flags; if (flags & FLAG_VSYNC_HINT) diff --git a/src/platforms/rcore_desktop_sdl.c b/src/platforms/rcore_desktop_sdl.c index 70d529202..1621dd2a5 100644 --- a/src/platforms/rcore_desktop_sdl.c +++ b/src/platforms/rcore_desktop_sdl.c @@ -518,6 +518,8 @@ void RestoreWindow(void) // Set window configuration state using flags void SetWindowState(unsigned int flags) { + if (!CORE.Window.ready) TRACELOG(LOG_WARNING, "WINDOW: SetWindowState does nothing before window initialization, Use \"SetConfigFlags\" instead"); + CORE.Window.flags |= flags; if (flags & FLAG_VSYNC_HINT) diff --git a/src/platforms/rcore_web.c b/src/platforms/rcore_web.c index b3bb43b5b..bf5a6ba5a 100644 --- a/src/platforms/rcore_web.c +++ b/src/platforms/rcore_web.c @@ -364,6 +364,8 @@ void RestoreWindow(void) // Set window configuration state using flags void SetWindowState(unsigned int flags) { + if (!CORE.Window.ready) TRACELOG(LOG_WARNING, "WINDOW: SetWindowState does nothing before window initialization, Use \"SetConfigFlags\" instead"); + // Check previous state and requested state to apply required changes // NOTE: In most cases the functions already change the flags internally diff --git a/src/rcore.c b/src/rcore.c index ec6c94e94..5b2679c95 100644 --- a/src/rcore.c +++ b/src/rcore.c @@ -1905,6 +1905,8 @@ void TakeScreenshot(const char *fileName) // To configure window states after creation, just use SetWindowState() void SetConfigFlags(unsigned int flags) { + if (CORE.Window.ready) TRACELOG(LOG_WARNING, "WINDOW: SetConfigFlags called after window initialization, Use \"SetWindowState\" to set flags instead"); + // Selected flags are set but not evaluated at this point, // flag evaluation happens at InitWindow() or SetWindowState() CORE.Window.flags |= flags;