mirror of
https://github.com/glfw/glfw.git
synced 2024-11-11 04:53:50 +00:00
Avoid mode re-enumeration, take two.
This commit is contained in:
parent
f4387139e0
commit
770daa19c8
@ -79,6 +79,9 @@ static int refreshVideoModes(_GLFWmonitor* monitor)
|
||||
{
|
||||
int modeCount;
|
||||
|
||||
if (monitor->modes)
|
||||
return GL_TRUE;
|
||||
|
||||
GLFWvidmode* modes = _glfwPlatformGetVideoModes(monitor, &modeCount);
|
||||
if (!modes)
|
||||
return GL_FALSE;
|
||||
@ -340,11 +343,8 @@ GLFWAPI const GLFWvidmode* glfwGetVideoModes(GLFWmonitor* handle, int* count)
|
||||
|
||||
_GLFW_REQUIRE_INIT_OR_RETURN(NULL);
|
||||
|
||||
if (monitor->modes == NULL)
|
||||
{
|
||||
if (!refreshVideoModes(monitor))
|
||||
return GL_FALSE;
|
||||
}
|
||||
if (!refreshVideoModes(monitor))
|
||||
return NULL;
|
||||
|
||||
*count = monitor->modeCount;
|
||||
return monitor->modes;
|
||||
|
Loading…
Reference in New Issue
Block a user