Move GetMonitorPhysicalWidth from rcore to submodule

This commit is contained in:
MichaelFiber 2023-09-18 16:15:21 -04:00
commit c89d178e8d

View file

@ -1507,3 +1507,20 @@ const char *GetGamepadName(int gamepad)
return name;
}
// Get selected monitor physical width in millimetres
int GetMonitorPhysicalWidth(int monitor)
{
int monitorCount;
GLFWmonitor **monitors = glfwGetMonitors(&monitorCount);
if ((monitor >= 0) && (monitor < monitorCount))
{
int physicalWidth;
glfwGetMonitorPhysicalSize(monitors[monitor], &physicalWidth, NULL);
return physicalWidth;
}
else TRACELOG(LOG_WARNING, "GLFW: Failed to find selected monitor");
return 0;
}