diff --git a/src/raylib.h b/src/raylib.h index 108ab0245..beedbc1fa 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -973,6 +973,7 @@ RLAPI int GetMonitorPhysicalWidth(int monitor); // Get specifi RLAPI int GetMonitorPhysicalHeight(int monitor); // Get specified monitor physical height in millimetres RLAPI int GetMonitorRefreshRate(int monitor); // Get specified monitor refresh rate RLAPI Vector2 GetWindowPosition(void); // Get window position XY on monitor +RLAPI Vector2 GetWindowSize(void); // Get window size on monitor RLAPI Vector2 GetWindowScaleDPI(void); // Get window scale DPI factor RLAPI const char *GetMonitorName(int monitor); // Get the human-readable, UTF-8 encoded name of the specified monitor RLAPI void SetClipboardText(const char *text); // Set clipboard text content diff --git a/src/rcore.c b/src/rcore.c index d6aeaec96..29b1425f7 100644 --- a/src/rcore.c +++ b/src/rcore.c @@ -1972,6 +1972,17 @@ Vector2 GetWindowPosition(void) return (Vector2){ (float)x, (float)y }; } +// Get window size on monitor +Vector2 GetWindowSize(void) +{ + int x = 0; + int y = 0; +#if defined(PLATFORM_DESKTOP) + glfwGetWindowSize(CORE.Window.handle, &x, &y); +#endif + return (Vector2){ (float)x, (float)y }; +} + // Get window scale DPI factor for current monitor Vector2 GetWindowScaleDPI(void) {