Move GetMonitorPhysicalWidth from rcore to submodule

This commit is contained in:
MichaelFiber 2023-09-18 16:15:21 -04:00
parent ed5a68e6fb
commit c89d178e8d
5 changed files with 38 additions and 18 deletions

View File

@ -410,24 +410,6 @@ int GetRenderHeight(void)
return CORE.Window.render.height; return CORE.Window.render.height;
} }
// Get selected monitor physical width in millimetres
int GetMonitorPhysicalWidth(int monitor)
{
#if defined(PLATFORM_DESKTOP)
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");
#endif
return 0;
}
// Enable waiting for events on EndDrawing(), no automatic event polling // Enable waiting for events on EndDrawing(), no automatic event polling
void EnableEventWaiting(void) void EnableEventWaiting(void)
{ {

View File

@ -1633,3 +1633,10 @@ const char *GetGamepadName(int gamepad)
{ {
return NULL; return NULL;
} }
// Get selected monitor physical width in millimetres
int GetMonitorPhysicalWidth(int monitor)
{
return 0;
}

View File

@ -1507,3 +1507,20 @@ const char *GetGamepadName(int gamepad)
return name; 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;
}

View File

@ -955,3 +955,10 @@ const char *GetGamepadName(int gamepad)
return name; return name;
} }
// Get selected monitor physical width in millimetres
int GetMonitorPhysicalWidth(int monitor)
{
return 0;
}

View File

@ -1555,3 +1555,10 @@ const char *GetGamepadName(int gamepad)
return name; return name;
} }
// Get selected monitor physical width in millimetres
int GetMonitorPhysicalWidth(int monitor)
{
return 0;
}