MCPcopy Create free account
hub / github.com/ddiakopoulos/polymer / get_current_monitor

Function get_current_monitor

libraries/lib-app-base/src/glfw-app.cpp:287–305  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

285}
286
287int 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
307int2 get_screen_size(GLFWwindow * window)
308{

Callers 2

get_screen_sizeFunction · 0.85
enter_fullscreenMethod · 0.85

Calls 1

containsMethod · 0.45

Tested by

no test coverage detected