[add] GetMonitorRefreshRate(int monitor); (#1289)
This commit is contained in:
parent
be80708d41
commit
25fb24ba7d
2 changed files with 17 additions and 0 deletions
16
src/core.c
16
src/core.c
|
@ -1195,6 +1195,22 @@ int GetMonitorPhysicalHeight(int monitor)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int GetMonitorRefreshRate(int monitor)
|
||||||
|
{
|
||||||
|
#if defined(PLATFORM_DESKTOP)
|
||||||
|
int monitorCount;
|
||||||
|
GLFWmonitor **monitors = glfwGetMonitors(&monitorCount);
|
||||||
|
|
||||||
|
if ((monitor >= 0) && (monitor < monitorCount))
|
||||||
|
{
|
||||||
|
const GLFWvidmode *vidmode = glfwGetVideoMode(monitors[monitor]);
|
||||||
|
return vidmode->refreshRate;
|
||||||
|
}
|
||||||
|
else TRACELOG(LOG_WARNING, "GLFW: Failed to find selected monitor");
|
||||||
|
#endif
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
// Get window position XY on monitor
|
// Get window position XY on monitor
|
||||||
Vector2 GetWindowPosition(void)
|
Vector2 GetWindowPosition(void)
|
||||||
{
|
{
|
||||||
|
|
|
@ -892,6 +892,7 @@ RLAPI int GetMonitorWidth(int monitor); // Get primary
|
||||||
RLAPI int GetMonitorHeight(int monitor); // Get primary monitor height
|
RLAPI int GetMonitorHeight(int monitor); // Get primary monitor height
|
||||||
RLAPI int GetMonitorPhysicalWidth(int monitor); // Get primary monitor physical width in millimetres
|
RLAPI int GetMonitorPhysicalWidth(int monitor); // Get primary monitor physical width in millimetres
|
||||||
RLAPI int GetMonitorPhysicalHeight(int monitor); // Get primary monitor physical height in millimetres
|
RLAPI int GetMonitorPhysicalHeight(int monitor); // Get primary monitor physical height in millimetres
|
||||||
|
RLAPI int GetMonitorRefreshRate(int monitor); // Get primary monitor refresh rate
|
||||||
RLAPI Vector2 GetWindowPosition(void); // Get window position XY on monitor
|
RLAPI Vector2 GetWindowPosition(void); // Get window position XY on monitor
|
||||||
RLAPI Vector2 GetWindowScaleDPI(void); // Get window scale DPI factor
|
RLAPI Vector2 GetWindowScaleDPI(void); // Get window scale DPI factor
|
||||||
RLAPI const char *GetMonitorName(int monitor); // Get the human-readable, UTF-8 encoded name of the primary monitor
|
RLAPI const char *GetMonitorName(int monitor); // Get the human-readable, UTF-8 encoded name of the primary monitor
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue