glfw: glfwGetMonitors can return null to signify no monitors

This commit is contained in:
Lee Cannon 2022-02-09 21:45:59 +00:00 committed by Stephen Gutekanst
parent bc8ce57e53
commit 8d2a4cd8d2

View file

@ -398,7 +398,8 @@ pub inline fn getAll(allocator: mem.Allocator) mem.Allocator.Error![]Monitor {
Error.NotInitialized => unreachable, Error.NotInitialized => unreachable,
else => unreachable, else => unreachable,
}; };
unreachable; // `glfwGetMonitors` returning null can be either an error or no monitors
return &[_]Monitor{};
} }
/// Returns the primary monitor. /// Returns the primary monitor.