Restore legacy OpenGL 2.1 support.

This commit is contained in:
Paul Chote
2020-04-22 00:13:23 +01:00
committed by abcdefg30
parent 839be24053
commit dac1f270ce
10 changed files with 224 additions and 39 deletions

View File

@@ -151,9 +151,9 @@ namespace OpenRA.Platforms.Default
// We first need to query the available profiles on Windows/Linux.
// On macOS, known/consistent OpenGL support is provided by the OS.
if (Platform.CurrentPlatform == PlatformType.OSX)
supportedProfiles = new[] { GLProfile.Modern };
supportedProfiles = new[] { GLProfile.Modern, GLProfile.Legacy };
else
supportedProfiles = new[] { GLProfile.Modern, GLProfile.Embedded }
supportedProfiles = new[] { GLProfile.Modern, GLProfile.Embedded, GLProfile.Legacy }
.Where(CanCreateGLWindow)
.ToArray();
@@ -487,6 +487,10 @@ namespace OpenRA.Platforms.Default
SDL.SDL_GL_SetAttribute(SDL.SDL_GLattr.SDL_GL_CONTEXT_MINOR_VERSION, 0);
SDL.SDL_GL_SetAttribute(SDL.SDL_GLattr.SDL_GL_CONTEXT_PROFILE_MASK, (int)SDL.SDL_GLprofile.SDL_GL_CONTEXT_PROFILE_ES);
break;
case GLProfile.Legacy:
SDL.SDL_GL_SetAttribute(SDL.SDL_GLattr.SDL_GL_CONTEXT_MAJOR_VERSION, 2);
SDL.SDL_GL_SetAttribute(SDL.SDL_GLattr.SDL_GL_CONTEXT_MINOR_VERSION, 1);
break;
}
}