From 0009d57ebb454b22f06b08c6c606c55ae8202969 Mon Sep 17 00:00:00 2001 From: x29a <0.x29a.0@gmail.com> Date: Wed, 15 Feb 2017 20:38:14 +0100 Subject: [PATCH] display glfw errors by registering an error callback (see http://www.glfw.org/docs/latest/intro_guide.html#error_handling) --- main.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/main.c b/main.c index 877736e..d751c89 100644 --- a/main.c +++ b/main.c @@ -1466,6 +1466,11 @@ static void init_default_texture() { GL_RGBA, GL_UNSIGNED_BYTE, white_pixel); } +static void glfw_error_callback(int error, const char* description) +{ + fprintf(stderr, "glfw error %d (%s)\n", error, description); +} + int main(int argc, char *argv[]) { fprintf(stdout, VERSION_STRING " (" INFO_URL ")\n"); fprintf(stdout, "Copyright (c) 2015 Florian Wesch \n\n"); @@ -1512,6 +1517,7 @@ int main(int argc, char *argv[]) { if (inotify_fd == -1) die("cannot open inotify: %s", strerror(errno)); + glfwSetErrorCallback(glfw_error_callback); av_register_all(); event_base = event_init();