From f4387139e056af10cce7c8cde17a3f0919898223 Mon Sep 17 00:00:00 2001 From: Camilla Berglund Date: Fri, 7 Jun 2013 13:57:17 +0200 Subject: [PATCH] Avoid mode re-enumeration. --- src/monitor.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/monitor.c b/src/monitor.c index 337e57e2..7ec1bba7 100644 --- a/src/monitor.c +++ b/src/monitor.c @@ -340,8 +340,11 @@ GLFWAPI const GLFWvidmode* glfwGetVideoModes(GLFWmonitor* handle, int* count) _GLFW_REQUIRE_INIT_OR_RETURN(NULL); - if (!refreshVideoModes(monitor)) - return GL_FALSE; + if (monitor->modes == NULL) + { + if (!refreshVideoModes(monitor)) + return GL_FALSE; + } *count = monitor->modeCount; return monitor->modes;