瀏覽代碼

REVIEWED: `GetRender*()` issue on macOS highDPI #3367

pull/3488/head
Ray 1 年之前
父節點
當前提交
9642fffbbb
共有 1 個檔案被更改,包括 16 行新增2 行删除
  1. +16
    -2
      src/rcore.c

+ 16
- 2
src/rcore.c 查看文件

@ -748,13 +748,27 @@ 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)
{ {
return CORE.Window.render.width;
int width = 0;
#if defined(__APPLE__)
Vector2 scale = GetWindowScaleDPI();
width = (int)((float)CORE.Window.render.width*scale.x);
#else
width = CORE.Window.render.width;
#endif
return width;
} }
// 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)
{ {
return CORE.Window.render.height;
int height = 0;
#if defined(__APPLE__)
Vector2 scale = GetWindowScaleDPI();
height = (int)((float)CORE.Window.render.width*scale.y);
#else
height = CORE.Window.render.height;
#endif
return height;
} }
// Enable waiting for events on EndDrawing(), no automatic event polling // Enable waiting for events on EndDrawing(), no automatic event polling

Loading…
取消
儲存