Skip to content

Commit

Permalink
gl: Ifdef init hint on unsupported GLFW versions
Browse files Browse the repository at this point in the history
  • Loading branch information
mpiatka committed Mar 7, 2024
1 parent 00c6bc4 commit 2ece079
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/video_display/gl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 2ece079

Please sign in to comment.