Selaa lähdekoodia

Add GLFW error handler to show error messages, hopefully gives more descriptive errors (hopefully helps #149)

Signed-off-by: Alexis Maiquez <almamu@almamu.com>
Alexis Maiquez 3 vuotta sitten
vanhempi
commit
847cd56ddf
1 muutettua tiedostoa jossa 7 lisäystä ja 0 poistoa
  1. 7 0
      src/WallpaperEngine/Render/Drivers/COpenGLDriver.cpp

+ 7 - 0
src/WallpaperEngine/Render/Drivers/COpenGLDriver.cpp

@@ -4,9 +4,16 @@
 
 using namespace WallpaperEngine::Render::Drivers;
 
+void CustomGLFWErrorHandler (int errorCode, const char* reason)
+{
+	sLog.error ("GLFW error ", errorCode, ": ", reason);
+}
+
 COpenGLDriver::COpenGLDriver (const char* windowTitle) :
     m_frameCounter (0)
 {
+	glfwSetErrorCallback (CustomGLFWErrorHandler);
+
     // initialize glfw
     if (glfwInit () == GLFW_FALSE)
         sLog.exception ("Failed to initialize glfw");