diff --git a/src/raylib.h b/src/raylib.h index 035f6f2bf..f3ab9d4b6 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -988,6 +988,7 @@ 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 float GetCurrentAspect(); // Get current aspect (from the current FBO) 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 b229589f7..3225276ec 100644 --- a/src/rcore.c +++ b/src/rcore.c @@ -788,6 +788,12 @@ int GetRenderHeight(void) return height; } +// Get current aspect (from the current FBO) +float GetCurrentAspect() +{ + return (float)CORE.Window.currentFbo.width/(float)CORE.Window.currentFbo.height; +} + // Enable waiting for events on EndDrawing(), no automatic event polling void EnableEventWaiting(void) {