GLFW: improved init handling (print error)

This commit is contained in:
Martin Pulec
2022-04-26 15:34:48 +02:00
parent 54aa7c2c8a
commit e9e2edc67b

View File

@@ -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);