From 1e4d3e26613e28f32085ba5932acfc3e91efa4ea Mon Sep 17 00:00:00 2001 From: Keegan McAllister Date: Thu, 17 Oct 2013 18:06:00 -0700 Subject: [PATCH] Print GLFW errors --- src/components/main/platform/common/glfw_windowing.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/components/main/platform/common/glfw_windowing.rs b/src/components/main/platform/common/glfw_windowing.rs index 0a7f255665c..60eaa421c6c 100644 --- a/src/components/main/platform/common/glfw_windowing.rs +++ b/src/components/main/platform/common/glfw_windowing.rs @@ -27,6 +27,11 @@ pub struct Application; impl ApplicationMethods for Application { fn new() -> Application { + // Per GLFW docs it's safe to set the error callback before calling + // glfwInit(), and this way we notice errors from init too. + do glfw::set_error_callback |_error_code, description| { + error!("GLFW error: %s", description); + }; glfw::init(); Application }