Browse Source

Fixes GetCurrentMonitor() detection inconsistency issue (#3215)

pull/3216/head
ubkp 1 year ago
committed by GitHub
parent
commit
4fd40f0333
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 15 additions and 11 deletions
  1. +15
    -11
      src/rcore.c

+ 15
- 11
src/rcore.c View File

@ -1835,20 +1835,24 @@ int GetCurrentMonitor(void)
int mx = 0;
int my = 0;
int width = 0;
int height = 0;
monitor = monitors[i];
glfwGetMonitorWorkarea(monitor, &mx, &my, &width, &height);
if ((x >= mx) &&
(x < (mx + width)) &&
(y >= my) &&
(y < (my + height)))
glfwGetMonitorPos(monitor, &mx, &my);
const GLFWvidmode *mode = glfwGetVideoMode(monitor);
if (mode)
{
index = i;
break;
const int width = mode->width;
const int height = mode->height;
if ((x >= mx) &&
(x < (mx + width)) &&
(y >= my) &&
(y < (my + height)))
{
index = i;
break;
}
}
else TRACELOG(LOG_WARNING, "GLFW: Failed to find video mode for selected monitor");
}
}
}

Loading…
Cancel
Save