diff --git a/gfx/drivers_context/wgl_ctx.c b/gfx/drivers_context/wgl_ctx.c index 151725fbdf..26f598af06 100644 --- a/gfx/drivers_context/wgl_ctx.c +++ b/gfx/drivers_context/wgl_ctx.c @@ -281,7 +281,7 @@ static void create_gl_context(HWND hwnd, bool *quit) if (pcreate_context) { int i; - int gl_versions[][2] = {{4, 6}, {4, 3}, {4, 0}, {3, 3}, {3, 2}, {0, 0}}; + int gl_versions[][2] = {{4, 6}, {4, 5}, {4, 4}, {4, 3}, {4, 2}, {4, 1}, {4, 0}, {3, 3}, {3, 2}, {0, 0}}; int gl_version_rows = ARRAY_SIZE(gl_versions); int (*versions)[2]; int version_rows = 0; @@ -318,7 +318,15 @@ static void create_gl_context(HWND hwnd, bool *quit) } } else - continue; + { + if (versions[i][0] == g_major && versions[i][1] == g_minor) + { + /* The requested version is not supported, go ahead and fail since everything else will be lower than that. */ + break; + } + + continue; + } if (win32_use_hw_ctx) { diff --git a/gfx/drivers_context/x_ctx.c b/gfx/drivers_context/x_ctx.c index c6ae94ea2a..969197e4d7 100644 --- a/gfx/drivers_context/x_ctx.c +++ b/gfx/drivers_context/x_ctx.c @@ -871,7 +871,7 @@ static bool gfx_ctx_x_set_video_mode(void *data, */ { int i; - int gl_versions[][2] = {{4, 6}, {4, 3}, {4, 0}, {3, 3}, {3, 2}, {0, 0}}; + int gl_versions[][2] = {{4, 6}, {4, 5}, {4, 4}, {4, 3}, {4, 2}, {4, 1}, {4, 0}, {3, 3}, {3, 2}, {0, 0}}; #ifdef HAVE_OPENGLES3 int gles_versions[][2] = {{3, 2}, {3, 1}, {3, 0}, {0, 0}}; #else @@ -910,7 +910,15 @@ static bool gfx_ctx_x_set_video_mode(void *data, x->g_fbc, NULL, True, attribs); if (!x->g_ctx) + { + if (versions[i][0] == g_major && versions[i][1] == g_minor) + { + /* The requested version is not supported, go ahead and fail since everything else will be lower than that. */ + break; + } + continue; + } if (x->g_use_hw_ctx) {