fix bug with GetCurrentMonitor

This commit is contained in:
Colleague Riley 2024-07-08 12:47:20 -04:00
parent 96f8e3c920
commit 29f58d987e

View File

@ -564,16 +564,16 @@ int GetMonitorCount(void)
// Get number of monitors // Get number of monitors
int GetCurrentMonitor(void) int GetCurrentMonitor(void)
{ {
int current = 0;
RGFW_monitor *mons = RGFW_getMonitors(); RGFW_monitor *mons = RGFW_getMonitors();
RGFW_monitor mon = RGFW_window_getMonitor(platform.window); RGFW_monitor mon = RGFW_window_getMonitor(platform.window);
for (int i = 0; i < 6; i++) for (int i = 0; i < 6; i++)
{ {
if ((mons[i].rect.x == mon.rect.x) && (mons[i].rect.y == mon.rect.y)) current = i; if ((mons[i].rect.x == mon.rect.x) && (mons[i].rect.y == mon.rect.y))
return i;
} }
return current; return 0;
} }
// Get selected monitor position // Get selected monitor position