diff options
| author | Shylie <[email protected]> | 2020-06-24 12:28:57 -0400 |
|---|---|---|
| committer | GitHub <[email protected]> | 2020-06-24 18:28:57 +0200 |
| commit | 25fb24ba7d8cb90a32ae3b7a57f4a1a87a8f7319 (patch) | |
| tree | dbd7a676183aaa502226a0345dca11f0c59f7ccc /src/core.c | |
| parent | be80708d41bcf6805ba2a4031999011f52fdb9ad (diff) | |
| download | raylib-25fb24ba7d8cb90a32ae3b7a57f4a1a87a8f7319.tar.gz raylib-25fb24ba7d8cb90a32ae3b7a57f4a1a87a8f7319.zip | |
[add] GetMonitorRefreshRate(int monitor); (#1289)
Diffstat (limited to 'src/core.c')
| -rw-r--r-- | src/core.c | 16 |
1 files changed, 16 insertions, 0 deletions
@@ -1195,6 +1195,22 @@ int GetMonitorPhysicalHeight(int monitor) 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 Vector2 GetWindowPosition(void) { |
