From ca3ef2fc260387d497ad0a2e585827fbd8518e76 Mon Sep 17 00:00:00 2001 From: ubkp <118854183+ubkp@users.noreply.github.com> Date: Sun, 10 Dec 2023 18:43:02 -0300 Subject: [PATCH] Add FLAG_WINDOW_RESIZABLE to SetWindowState() and ClearWindowState() for PLATFORM_WEB --- src/platforms/rcore_web.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/platforms/rcore_web.c b/src/platforms/rcore_web.c index 71286cbb0..fcb1c896d 100644 --- a/src/platforms/rcore_web.c +++ b/src/platforms/rcore_web.c @@ -257,9 +257,10 @@ void SetWindowState(unsigned int flags) } // State change: FLAG_WINDOW_RESIZABLE - if ((flags & FLAG_WINDOW_RESIZABLE) > 0) + if (((CORE.Window.flags & FLAG_WINDOW_RESIZABLE) != (flags & FLAG_WINDOW_RESIZABLE)) && ((flags & FLAG_WINDOW_RESIZABLE) > 0)) { - TRACELOG(LOG_WARNING, "SetWindowState(FLAG_WINDOW_RESIZABLE) not available yet on target platform"); + glfwSetWindowAttrib(platform.handle, GLFW_RESIZABLE, GLFW_TRUE); + CORE.Window.flags |= FLAG_WINDOW_RESIZABLE; } // State change: FLAG_WINDOW_UNDECORATED @@ -363,9 +364,10 @@ void ClearWindowState(unsigned int flags) } // State change: FLAG_WINDOW_RESIZABLE - if ((flags & FLAG_WINDOW_RESIZABLE) > 0) + if (((CORE.Window.flags & FLAG_WINDOW_RESIZABLE) > 0) && ((flags & FLAG_WINDOW_RESIZABLE) > 0)) { - TRACELOG(LOG_WARNING, "ClearWindowState(FLAG_WINDOW_RESIZABLE) not available yet on target platform"); + glfwSetWindowAttrib(platform.handle, GLFW_RESIZABLE, GLFW_FALSE); + CORE.Window.flags &= ~FLAG_WINDOW_RESIZABLE; } // State change: FLAG_WINDOW_HIDDEN