Skip to content
This repository has been archived by the owner on May 1, 2020. It is now read-only.

display glfw errors by registering an error callback #56

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 <[email protected]>\n\n");
Expand Down Expand Up @@ -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();
Expand Down