瀏覽代碼

lookup the returned monitor in the list of monitors to get an index. (#1490)

pull/1492/head
Jeffery Myers 4 年之前
committed by GitHub
父節點
當前提交
24b6dcf29f
沒有發現已知的金鑰在資料庫的簽署中 GPG 金鑰 ID: 4AEE18F83AFDEB23
共有 1 個檔案被更改,包括 10 行新增1 行删除
  1. +10
    -1
      src/core.c

+ 10
- 1
src/core.c 查看文件

@ -1456,7 +1456,16 @@ int GetMonitorCount(void)
int GetCurrentMonitor(void)
{
#if defined(PLATFORM_DESKTOP)
return glfwGetWindowMonitor(CORE.Window.handle);
int monitorCount;
GLFWmonitor** monitors = glfwGetMonitors(&monitorCount);
GLFWmonitor* monitor = glfwGetWindowMonitor(CORE.Window.handle);
for (int i = 0; i < monitorCount; i++)
{
if (monitors[i] == monitor)
return i;
}
return 0;
#else
return 0;
#endif

Loading…
取消
儲存