Added saving of monitor mode count.
This commit is contained in:
parent
f558563621
commit
b66e1de97c
@ -241,6 +241,7 @@ struct _GLFWmonitor
|
||||
int positionY;
|
||||
|
||||
GLFWvidmode* modes;
|
||||
int modeCount;
|
||||
|
||||
// These are defined in the current port's platform.h
|
||||
_GLFW_PLATFORM_MONITOR_STATE;
|
||||
|
@ -399,10 +399,16 @@ GLFWAPI const GLFWvidmode* glfwGetVideoModes(GLFWmonitor handle, int* count)
|
||||
|
||||
free(monitor->modes);
|
||||
|
||||
monitor->modes = _glfwPlatformGetVideoModes(monitor, count);
|
||||
monitor->modes = _glfwPlatformGetVideoModes(monitor, &monitor->modeCount);
|
||||
if (monitor->modes)
|
||||
qsort(monitor->modes, *count, sizeof(GLFWvidmode), compareVideoModes);
|
||||
{
|
||||
qsort(monitor->modes,
|
||||
monitor->modeCount,
|
||||
sizeof(GLFWvidmode),
|
||||
compareVideoModes);
|
||||
}
|
||||
|
||||
*count = monitor->modeCount;
|
||||
return monitor->modes;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user