1
0
Fork 0
mirror of https://github.com/gwm17/glfw.git synced 2024-11-23 10:48:51 -05:00

Added saving of monitor mode count.

This commit is contained in:
Camilla Berglund 2012-12-27 18:37:55 +01:00
parent f558563621
commit b66e1de97c
2 changed files with 9 additions and 2 deletions

View File

@ -241,6 +241,7 @@ struct _GLFWmonitor
int positionY; int positionY;
GLFWvidmode* modes; GLFWvidmode* modes;
int modeCount;
// These are defined in the current port's platform.h // These are defined in the current port's platform.h
_GLFW_PLATFORM_MONITOR_STATE; _GLFW_PLATFORM_MONITOR_STATE;

View File

@ -399,10 +399,16 @@ GLFWAPI const GLFWvidmode* glfwGetVideoModes(GLFWmonitor handle, int* count)
free(monitor->modes); free(monitor->modes);
monitor->modes = _glfwPlatformGetVideoModes(monitor, count); monitor->modes = _glfwPlatformGetVideoModes(monitor, &monitor->modeCount);
if (monitor->modes) if (monitor->modes)
qsort(monitor->modes, *count, sizeof(GLFWvidmode), compareVideoModes); {
qsort(monitor->modes,
monitor->modeCount,
sizeof(GLFWvidmode),
compareVideoModes);
}
*count = monitor->modeCount;
return monitor->modes; return monitor->modes;
} }