mirror of
https://github.com/glfw/glfw.git
synced 2024-11-22 21:14:35 +00:00
parent
49cf82a0ac
commit
2fbd948a67
@ -62,6 +62,8 @@ GLFW bundles a number of dependencies in the `deps/` directory.
|
|||||||
|
|
||||||
## Changelog
|
## Changelog
|
||||||
|
|
||||||
|
- Bugfix: Initialization failed on headless systems
|
||||||
|
|
||||||
|
|
||||||
## Contact
|
## Contact
|
||||||
|
|
||||||
|
@ -129,13 +129,6 @@ GLFWAPI int glfwInit(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
_glfw.monitors = _glfwPlatformGetMonitors(&_glfw.monitorCount);
|
_glfw.monitors = _glfwPlatformGetMonitors(&_glfw.monitorCount);
|
||||||
if (!_glfw.monitorCount)
|
|
||||||
{
|
|
||||||
_glfwInputError(GLFW_PLATFORM_ERROR, "No monitors found");
|
|
||||||
_glfwPlatformTerminate();
|
|
||||||
return GL_FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
_glfwInitialized = GL_TRUE;
|
_glfwInitialized = GL_TRUE;
|
||||||
|
|
||||||
// Not all window hints have zero as their default value
|
// Not all window hints have zero as their default value
|
||||||
|
@ -305,6 +305,10 @@ GLFWAPI GLFWmonitor** glfwGetMonitors(int* count)
|
|||||||
GLFWAPI GLFWmonitor* glfwGetPrimaryMonitor(void)
|
GLFWAPI GLFWmonitor* glfwGetPrimaryMonitor(void)
|
||||||
{
|
{
|
||||||
_GLFW_REQUIRE_INIT_OR_RETURN(NULL);
|
_GLFW_REQUIRE_INIT_OR_RETURN(NULL);
|
||||||
|
|
||||||
|
if (!_glfw.monitorCount)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
return (GLFWmonitor*) _glfw.monitors[0];
|
return (GLFWmonitor*) _glfw.monitors[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user