diff --git a/src/raylib.h b/src/raylib.h index 0d862a022..b1b75161c 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -986,6 +986,7 @@ RLAPI void SetWindowFocused(void); // Set window RLAPI void *GetWindowHandle(void); // Get native window handle RLAPI int GetScreenWidth(void); // Get current screen width RLAPI int GetScreenHeight(void); // Get current screen height +RLAPI Vector2 GetScreenSize(void); // Get current screen width and height as a Vector2 RLAPI int GetRenderWidth(void); // Get current render width (it considers HiDPI) RLAPI int GetRenderHeight(void); // Get current render height (it considers HiDPI) RLAPI int GetMonitorCount(void); // Get number of connected monitors diff --git a/src/rcore.c b/src/rcore.c index 9705495ee..79f5447f3 100644 --- a/src/rcore.c +++ b/src/rcore.c @@ -762,6 +762,12 @@ int GetScreenHeight(void) return CORE.Window.screen.height; } +// Get current screen width and height as a Vector2 +Vector2 GetScreenSize(void) +{ + return (Vector2){ (float)CORE.Window.screen.width, (float)CORE.Window.screen.height }; +} + // Get current render width which is equal to screen width*dpi scale int GetRenderWidth(void) {