From 847cd56ddf41a4e8f1fd7bc99f42b699f8c6da4c Mon Sep 17 00:00:00 2001 From: Alexis Maiquez Date: Tue, 21 Mar 2023 07:50:15 +0100 Subject: [PATCH] Add GLFW error handler to show error messages, hopefully gives more descriptive errors (hopefully helps #149) Signed-off-by: Alexis Maiquez --- src/WallpaperEngine/Render/Drivers/COpenGLDriver.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/WallpaperEngine/Render/Drivers/COpenGLDriver.cpp b/src/WallpaperEngine/Render/Drivers/COpenGLDriver.cpp index 8a4c2df..22b0c44 100644 --- a/src/WallpaperEngine/Render/Drivers/COpenGLDriver.cpp +++ b/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");