From e9e2edc67bbbbc7e844cd4f8c3fc309a85f2569e Mon Sep 17 00:00:00 2001 From: Martin Pulec Date: Tue, 26 Apr 2022 15:34:48 +0200 Subject: [PATCH] GLFW: improved init handling (print error) --- src/video_display/gl.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/video_display/gl.cpp b/src/video_display/gl.cpp index 9d27386ac..3c1454a4a 100644 --- a/src/video_display/gl.cpp +++ b/src/video_display/gl.cpp @@ -1157,13 +1157,13 @@ ADD_TO_PARAM(GL_DISABLE_10B_OPT_PARAM_NAME , */ static bool display_gl_init_opengl(struct state_gl *s) { - if (int ret = glfwInit(); ret == GLFW_FALSE) { - LOG(LOG_LEVEL_ERROR) << "glfwInit returned " << ret << "\n"; + glfwSetErrorCallback(glfw_print_error); + + if (glfwInit() == GLFW_FALSE) { + LOG(LOG_LEVEL_ERROR) << MOD_NAME << "glfwInit failed!\n"; return false; } - glfwSetErrorCallback(glfw_print_error); - if (commandline_params.find(GL_DISABLE_10B_OPT_PARAM_NAME) == commandline_params.end()) { for (auto const & bits : {GLFW_RED_BITS, GLFW_GREEN_BITS, GLFW_BLUE_BITS}) { glfwWindowHint(bits, 10);