diff options
| author | Jeffery Myers <[email protected]> | 2020-12-29 15:08:56 -0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2020-12-30 00:08:56 +0100 |
| commit | 24b6dcf29ff3ce8765da5e24a8ad4ae6df63bcaa (patch) | |
| tree | 5a3435ab1c6efdc0e6775c828cc85c377373bf51 /src | |
| parent | 22b179e66c01866ab8e3aee1b1114f5efbd89a00 (diff) | |
| download | raylib-24b6dcf29ff3ce8765da5e24a8ad4ae6df63bcaa.tar.gz raylib-24b6dcf29ff3ce8765da5e24a8ad4ae6df63bcaa.zip | |
lookup the returned monitor in the list of monitors to get an index. (#1490)
Diffstat (limited to 'src')
| -rw-r--r-- | src/core.c | 11 |
1 files changed, 10 insertions, 1 deletions
@@ -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 |
