aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/citra
diff options
context:
space:
mode:
authorGravatar Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>2014-11-28 23:35:57 +0000
committerGravatar Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>2014-11-29 23:03:04 +0000
commit648743cf66f99a0941929788b8c371643b217d35 (patch)
tree0d7e3100ad775186adf32bbd295162f67ee18093 /src/citra
parent83c3d37cd01e6f8f63b5bc27ba5754fa6ed70360 (diff)
GLFW: Add an error callback before calling glfwInit()
It will print a message to know what happened in case something went wrong in a GLFW call. Also replace every printf() in the glfw emu-window by ERROR_LOG().
Diffstat (limited to 'src/citra')
-rw-r--r--src/citra/emu_window/emu_window_glfw.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/citra/emu_window/emu_window_glfw.cpp b/src/citra/emu_window/emu_window_glfw.cpp
index 8efb39e2..697bf469 100644
--- a/src/citra/emu_window/emu_window_glfw.cpp
+++ b/src/citra/emu_window/emu_window_glfw.cpp
@@ -58,9 +58,13 @@ EmuWindow_GLFW::EmuWindow_GLFW() {
ReloadSetKeymaps();
+ glfwSetErrorCallback([](int error, const char *desc){
+ ERROR_LOG(GUI, "GLFW 0x%08x: %s", error, desc);
+ });
+
// Initialize the window
if(glfwInit() != GL_TRUE) {
- printf("Failed to initialize GLFW! Exiting...");
+ ERROR_LOG(GUI, "Failed to initialize GLFW! Exiting...");
exit(1);
}
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);
@@ -75,7 +79,7 @@ EmuWindow_GLFW::EmuWindow_GLFW() {
window_title.c_str(), NULL, NULL);
if (m_render_window == NULL) {
- printf("Failed to create GLFW window! Exiting...");
+ ERROR_LOG(GUI, "Failed to create GLFW window! Exiting...");
exit(1);
}