From d2bb57b2a83b6b5dcfdd49365518f94e565e6b91 Mon Sep 17 00:00:00 2001 From: Jeffery Myers Date: Sat, 6 Feb 2021 09:17:22 -0800 Subject: [PATCH] Adds GetCurrentFrameBuffertSize to allow client code to determine the current rendering size. --- src/core.c | 6 ++++++ src/raylib.h | 1 + 2 files changed, 7 insertions(+) diff --git a/src/core.c b/src/core.c index 20fb06f6f..f6667fe13 100644 --- a/src/core.c +++ b/src/core.c @@ -1429,6 +1429,12 @@ int GetScreenHeight(void) return CORE.Window.screen.height; } +// Get width and height of the current rendering context (screen or texture) +Vector2 GetCurrentFrameBuffertSize() +{ + return (Vector2) { (float)CORE.Window.currentFbo.width, (float)CORE.Window.currentFbo.height }; +} + // Get native window handle void *GetWindowHandle(void) { diff --git a/src/raylib.h b/src/raylib.h index 47dfa05f0..f1eb4fddb 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -918,6 +918,7 @@ RLAPI void SetWindowSize(int width, int height); // 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 GetCurrentFrameBuffertSize(); // Get width and height of the current rendering context (screen or texture) 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