Hide legacy GL support behind a feature flag.
This commit is contained in:
@@ -16,9 +16,9 @@ namespace OpenRA.Platforms.Default
|
||||
{
|
||||
public class DefaultPlatform : IPlatform
|
||||
{
|
||||
public IPlatformWindow CreateWindow(Size size, WindowMode windowMode, float scaleModifier, int batchSize, int videoDisplay, GLProfile profile)
|
||||
public IPlatformWindow CreateWindow(Size size, WindowMode windowMode, float scaleModifier, int batchSize, int videoDisplay, GLProfile profile, bool enableLegacyGL)
|
||||
{
|
||||
return new Sdl2PlatformWindow(size, windowMode, scaleModifier, batchSize, videoDisplay, profile);
|
||||
return new Sdl2PlatformWindow(size, windowMode, scaleModifier, batchSize, videoDisplay, profile, enableLegacyGL);
|
||||
}
|
||||
|
||||
public ISoundEngine CreateSound(string device)
|
||||
|
||||
@@ -135,7 +135,7 @@ namespace OpenRA.Platforms.Default
|
||||
static extern bool SetProcessDPIAware();
|
||||
|
||||
public Sdl2PlatformWindow(Size requestEffectiveWindowSize, WindowMode windowMode,
|
||||
float scaleModifier, int batchSize, int videoDisplay, GLProfile requestProfile)
|
||||
float scaleModifier, int batchSize, int videoDisplay, GLProfile requestProfile, bool enableLegacyGL)
|
||||
{
|
||||
// Lock the Window/Surface properties until initialization is complete
|
||||
lock (syncObject)
|
||||
@@ -148,7 +148,10 @@ namespace OpenRA.Platforms.Default
|
||||
|
||||
// Decide which OpenGL profile to use.
|
||||
// Prefer standard GL over GLES provided by the native driver
|
||||
var testProfiles = new List<GLProfile> { GLProfile.ANGLE, GLProfile.Modern, GLProfile.Embedded, GLProfile.Legacy };
|
||||
var testProfiles = new List<GLProfile> { GLProfile.ANGLE, GLProfile.Modern, GLProfile.Embedded };
|
||||
if (enableLegacyGL)
|
||||
testProfiles.Add(GLProfile.Legacy);
|
||||
|
||||
supportedProfiles = testProfiles
|
||||
.Where(CanCreateGLWindow)
|
||||
.ToArray();
|
||||
|
||||
Reference in New Issue
Block a user