Added saving of monitor mode count.
This commit is contained in:
parent
f558563621
commit
b66e1de97c
@ -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;
|
||||||
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user