Fixed initialization failing on headless systems.

Fixes #482.
This commit is contained in:
Camilla Berglund
2015-03-29 13:46:21 +02:00
parent 49cf82a0ac
commit 2fbd948a67
3 changed files with 6 additions and 7 deletions
+4
View File
@@ -305,6 +305,10 @@ GLFWAPI GLFWmonitor** glfwGetMonitors(int* count)
GLFWAPI GLFWmonitor* glfwGetPrimaryMonitor(void)
{
_GLFW_REQUIRE_INIT_OR_RETURN(NULL);
if (!_glfw.monitorCount)
return NULL;
return (GLFWmonitor*) _glfw.monitors[0];
}