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

Signed-off-by: Alexis Maiquez <almamu@almamu.com>
This commit is contained in:
Alexis Maiquez 2023-03-21 07:50:15 +01:00
parent 6d5c5b7825
commit 847cd56ddf

View File

@ -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");