From 2ece0791c67be06c6a1aa4ad2a48a22de3ef2d2e Mon Sep 17 00:00:00 2001 From: Martin Piatka Date: Thu, 7 Mar 2024 10:33:15 +0100 Subject: [PATCH] gl: Ifdef init hint on unsupported GLFW versions --- src/video_display/gl.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/video_display/gl.cpp b/src/video_display/gl.cpp index c39f6d075..bbde9235a 100644 --- a/src/video_display/gl.cpp +++ b/src/video_display/gl.cpp @@ -824,9 +824,15 @@ static void * display_gl_init(struct module *parent, const char *fmt, unsigned i keycontrol_register_key(&s->mod, i.first, msg, i.second.data()); } +#if GLFW_VERSION_MAJOR < 3 || (GLFW_VERSION_MAJOR == 3 && GLFW_VERSION_MINOR < 3) + if(!s->init_hints.empty()){ + log_msg(LOG_LEVEL_WARNING, "GLFW version < 3.3 doesn't support init hints. Ignoring them.\n"); + } +#else for (auto const &hint : s->init_hints) { glfwInitHint(hint.first, hint.second); } +#endif if (!display_gl_init_opengl(s)) { delete s;