| 285 | } |
| 286 | |
| 287 | int get_current_monitor(GLFWwindow * window) |
| 288 | { |
| 289 | int numberOfMonitors; |
| 290 | GLFWmonitor** monitors = glfwGetMonitors(&numberOfMonitors); |
| 291 | |
| 292 | int xW, yW; |
| 293 | glfwGetWindowPos(window, &xW, &yW); |
| 294 | |
| 295 | for (int iC = 0; iC < numberOfMonitors; iC++) |
| 296 | { |
| 297 | int xM, yM; |
| 298 | glfwGetMonitorPos(monitors[iC], &xM, &yM); |
| 299 | const GLFWvidmode * desktopMode = glfwGetVideoMode(monitors[iC]); |
| 300 | aabb_2d monitorRect {(float) xM, (float) yM, (float)xM + desktopMode->width, (float)yM + desktopMode->height}; |
| 301 | if (monitorRect.contains((float) xW, (float) yW)) |
| 302 | return iC; |
| 303 | } |
| 304 | return 0; |
| 305 | } |
| 306 | |
| 307 | int2 get_screen_size(GLFWwindow * window) |
| 308 | { |
no test coverage detected