瀏覽代碼

Merge pull request #5082 from JeffM2501/render_target_size

[CORE} Make GetRenderWidth/Height return the FBO size if one is active
pull/5083/head
Ray 2 月之前
committed by GitHub
父節點
當前提交
c4d733e864
沒有發現已知的金鑰在資料庫的簽署中 GPG Key ID: B5690EEEBB952194
共有 1 個文件被更改,包括 4 次插入0 次删除
  1. +4
    -0
      src/rcore.c

+ 4
- 0
src/rcore.c 查看文件

@ -827,6 +827,8 @@ int GetScreenHeight(void)
// Get current render width which is equal to screen width*dpi scale // Get current render width which is equal to screen width*dpi scale
int GetRenderWidth(void) int GetRenderWidth(void)
{ {
if (CORE.Window.usingFbo) return CORE.Window.currentFbo.width;
int width = 0; int width = 0;
#if defined(__APPLE__) #if defined(__APPLE__)
Vector2 scale = GetWindowScaleDPI(); Vector2 scale = GetWindowScaleDPI();
@ -840,6 +842,8 @@ int GetRenderWidth(void)
// Get current screen height which is equal to screen height*dpi scale // Get current screen height which is equal to screen height*dpi scale
int GetRenderHeight(void) int GetRenderHeight(void)
{ {
if (CORE.Window.usingFbo) return CORE.Window.currentFbo.height;
int height = 0; int height = 0;
#if defined(__APPLE__) #if defined(__APPLE__)
Vector2 scale = GetWindowScaleDPI(); Vector2 scale = GetWindowScaleDPI();

Loading…
取消
儲存