From 2a556fb2ce7f3e22f72b3da82118ce981a700373 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Nils=20Petter=20Sk=C3=A5lerud?= <np_skalerud@hotmail.com>
Date: Fri, 29 Mar 2019 14:26:39 +0100
Subject: [PATCH] Added simple error callback for GLFW3 for testing purposes.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Signed-off-by: Nils Petter Skålerud <np_skalerud@hotmail.com>
---
 src/Engine/Application.cpp | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/src/Engine/Application.cpp b/src/Engine/Application.cpp
index 81a463a..13507ac 100644
--- a/src/Engine/Application.cpp
+++ b/src/Engine/Application.cpp
@@ -5,6 +5,7 @@
 #include "GLFW/glfw3.h"
 
 #include <memory>
+#include <iostream>
 
 namespace Engine
 {
@@ -34,6 +35,11 @@ namespace Engine
 	}
 }
 
+void error_callback(int error, const char* description)
+{
+	std::cerr << "GLFW Error: " << description << std::endl;;
+}
+
 namespace Engine
 {
 	namespace Application
@@ -51,6 +57,8 @@ namespace Engine
 				data = std::make_unique<Data>();
 				data->isRunning = true;
 
+				glfwSetErrorCallback(error_callback);
+
 				glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 4);
 				glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 3);
 				glfwWindowHint(GLFW_OPENGL_DEBUG_CONTEXT, GL_TRUE);
-- 
GitLab