GTK+: Mandate OpenGL on Wayland.

Warn users if their OpenGL stack is too old.
This commit is contained in:
Brandon Wright 2018-11-09 14:55:33 -06:00
parent e5aed9f8d5
commit 3e87063780
2 changed files with 17 additions and 2 deletions

View File

@ -1631,6 +1631,12 @@ S9xDeinitUpdate (int width, int height)
static void
S9xInitDriver ()
{
#ifdef GDK_WINDOWING_WAYLAND
if (GDK_IS_WAYLAND_DISPLAY (gdk_display_get_default ()))
{
gui_config->hw_accel = HWA_OPENGL;
}
#endif
switch (gui_config->hw_accel)
{
#ifdef USE_OPENGL

View File

@ -538,10 +538,19 @@ int S9xOpenGLDisplayDriver::create_context ()
version = epoxy_gl_version ();
if (version < 20)
{
printf ("OpenGL version is only %d.%d. Need 2.0.\n"
"Trying to run anyway.",
printf ("OpenGL version is only %d.%d. Required version is 2.0.",
version / 10,
version % 10);
if (epoxy_has_gl_extension ("GL_EXT_fragment_shader") ||
epoxy_has_gl_extension ("GL_ARB_fragment_shader"))
{
printf ("Found GLSL capability. Continuing, but things may not work well.\n");
}
else
{
printf ("No GLSL available. Aborting.\n");
return 0;
}
}
int profile_mask = 0;