diff --git a/src/raylib.h b/src/raylib.h index 2a5a2f63f..137c7f1a6 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -955,6 +955,8 @@ RLAPI int GetScreenWidth(void); // Get current RLAPI int GetScreenHeight(void); // Get current screen height RLAPI int GetRenderWidth(void); // Get current render width (it considers HiDPI) RLAPI int GetRenderHeight(void); // Get current render height (it considers HiDPI) +RLAPI int GetClientWidth(void); // Get current client width +RLAPI int GetClientHeight(void); // Get current client height RLAPI int GetMonitorCount(void); // Get number of connected monitors RLAPI int GetCurrentMonitor(void); // Get current connected monitor RLAPI Vector2 GetMonitorPosition(int monitor); // Get specified monitor position diff --git a/src/rcore.c b/src/rcore.c index 476ea8e2f..bb5e99e63 100644 --- a/src/rcore.c +++ b/src/rcore.c @@ -1694,6 +1694,22 @@ int GetScreenHeight(void) return CORE.Window.screen.height; } +// Get current client width +int GetClientWidth(void) +{ + int width; + glfwGetWindowSize(CORE.Window.handle, &width, NULL); + return width; +} + +// Get current client height +int GetClientHeight(void) +{ + int height; + glfwGetWindowSize(CORE.Window.handle, NULL, &height); + return height; +} + // Get current render width which is equal to screen width * dpi scale int GetRenderWidth(void) {