Created
February 27, 2016 16:07
-
-
Save CounterPillow/5b8fc6ed7b21d2df88e9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <GLFW/glfw3.h> | |
#include <stdio.h> | |
int main() { | |
if (!glfwInit()) | |
return(-1); | |
int monitor_count; | |
GLFWmonitor** monitors = glfwGetMonitors(&monitor_count); | |
GLFWmonitor* primary = glfwGetPrimaryMonitor(); | |
for(int i = 0; i < monitor_count; i++) { | |
GLFWmonitor* mon = monitors[i]; | |
printf("Monitor %d, \"%s\"", i, glfwGetMonitorName(mon)); | |
if (mon == primary) { | |
printf(" (Primary)"); | |
} | |
printf("\n"); | |
int count; | |
const GLFWvidmode* modes = glfwGetVideoModes(mon, &count); | |
for(int j = 0; j < count; j++) { | |
GLFWvidmode mode = modes[j]; | |
printf("%dx%d @%dHz\n", mode.width, mode.height, mode.refreshRate); | |
} | |
printf("\n"); | |
} | |
glfwTerminate(); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment