Skip to content

Commit c4d733e

Browse files
authored
Merge pull request #5082 from JeffM2501/render_target_size
[CORE} Make GetRenderWidth/Height return the FBO size if one is active
2 parents b01c8a7 + bf536d6 commit c4d733e

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/rcore.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -827,6 +827,8 @@ int GetScreenHeight(void)
827827
// Get current render width which is equal to screen width*dpi scale
828828
int GetRenderWidth(void)
829829
{
830+
if (CORE.Window.usingFbo) return CORE.Window.currentFbo.width;
831+
830832
int width = 0;
831833
#if defined(__APPLE__)
832834
Vector2 scale = GetWindowScaleDPI();
@@ -840,6 +842,8 @@ int GetRenderWidth(void)
840842
// Get current screen height which is equal to screen height*dpi scale
841843
int GetRenderHeight(void)
842844
{
845+
if (CORE.Window.usingFbo) return CORE.Window.currentFbo.height;
846+
843847
int height = 0;
844848
#if defined(__APPLE__)
845849
Vector2 scale = GetWindowScaleDPI();

0 commit comments

Comments
 (0)