Переглянути джерело

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 ключ що відповідає даному підпису Ідентифікатор GPG ключа: 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

Завантаження…
Відмінити
Зберегти