opengl: add missing 4.x versions to try, fail early if requestion version does not work

This commit is contained in:
Brad Parker 2019-08-06 17:53:15 -04:00
parent 7479245875
commit 1c1db0a7de
2 changed files with 19 additions and 3 deletions

View File

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

View File

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