From bc0efbefd13ad335a8eaaf23a7bcd65ec27a0906 Mon Sep 17 00:00:00 2001 From: Paul Chote Date: Wed, 2 Mar 2016 19:35:58 +0000 Subject: [PATCH] Include OpenGL version string in sysinfo. --- OpenRA.Game/Graphics/IGraphicsDevice.cs | 2 ++ OpenRA.Game/Renderer.cs | 5 +++++ OpenRA.Mods.Common/Widgets/Logic/MainMenuLogic.cs | 3 ++- OpenRA.Platforms.Default/OpenGL.cs | 6 ++++-- OpenRA.Platforms.Default/Sdl2GraphicsDevice.cs | 2 ++ OpenRA.Platforms.Null/NullGraphicsDevice.cs | 2 ++ 6 files changed, 17 insertions(+), 3 deletions(-) diff --git a/OpenRA.Game/Graphics/IGraphicsDevice.cs b/OpenRA.Game/Graphics/IGraphicsDevice.cs index bc91eed255..b21154faab 100644 --- a/OpenRA.Game/Graphics/IGraphicsDevice.cs +++ b/OpenRA.Game/Graphics/IGraphicsDevice.cs @@ -78,6 +78,8 @@ namespace OpenRA IHardwareCursor CreateHardwareCursor(string name, Size size, byte[] data, int2 hotspot); void SetHardwareCursor(IHardwareCursor cursor); + + string GLVersion { get; } } public interface IVertexBuffer : IDisposable diff --git a/OpenRA.Game/Renderer.cs b/OpenRA.Game/Renderer.cs index 86df0a35d8..04232b179f 100644 --- a/OpenRA.Game/Renderer.cs +++ b/OpenRA.Game/Renderer.cs @@ -273,5 +273,10 @@ namespace OpenRA { return Device.SetClipboardText(text); } + + public string GLVersion + { + get { return Device.GLVersion; } + } } } diff --git a/OpenRA.Mods.Common/Widgets/Logic/MainMenuLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/MainMenuLogic.cs index a490400b5b..8150aebb37 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/MainMenuLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/MainMenuLogic.cs @@ -257,11 +257,12 @@ namespace OpenRA.Mods.Common.Widgets.Logic if (!Game.Settings.Debug.SendSystemInformation) return null; - return "?id={0}&platform={1}&os={2}&runtime={3}&lang={4}&version={5}&mod={6}&modversion={7}".F( + return "?id={0}&platform={1}&os={2}&runtime={3}&gl={4}&lang={5}&version={6}&mod={7}&modversion={8}".F( Uri.EscapeUriString(Game.Settings.Debug.UUID), Uri.EscapeUriString(Platform.CurrentPlatform.ToString()), Uri.EscapeUriString(Environment.OSVersion.ToString()), Uri.EscapeUriString(Platform.RuntimeVersion), + Uri.EscapeUriString(Game.Renderer.GLVersion), Uri.EscapeUriString(System.Globalization.CultureInfo.InstalledUICulture.TwoLetterISOLanguageName), Uri.EscapeUriString(ModMetadata.AllMods["modchooser"].Version), Uri.EscapeUriString(Game.ModData.Manifest.Mod.Id), diff --git a/OpenRA.Platforms.Default/OpenGL.cs b/OpenRA.Platforms.Default/OpenGL.cs index 88aee4ab0d..5d0ed06b51 100644 --- a/OpenRA.Platforms.Default/OpenGL.cs +++ b/OpenRA.Platforms.Default/OpenGL.cs @@ -33,6 +33,8 @@ namespace OpenRA.Platforms.Default public static GLFeatures Features { get; private set; } + public static string Version { get; private set; } + public const int GL_FALSE = 0; // ClearBufferMask @@ -452,8 +454,8 @@ namespace OpenRA.Platforms.Default { try { - var versionString = glGetString(GL_VERSION); - var version = versionString.Contains(" ") ? versionString.Split(' ')[0].Split('.') : versionString.Split('.'); + Version = glGetString(GL_VERSION); + var version = Version.Contains(" ") ? Version.Split(' ')[0].Split('.') : Version.Split('.'); var major = 0; if (version.Length > 0) diff --git a/OpenRA.Platforms.Default/Sdl2GraphicsDevice.cs b/OpenRA.Platforms.Default/Sdl2GraphicsDevice.cs index dd5822aee0..98687ae96b 100644 --- a/OpenRA.Platforms.Default/Sdl2GraphicsDevice.cs +++ b/OpenRA.Platforms.Default/Sdl2GraphicsDevice.cs @@ -395,5 +395,7 @@ namespace OpenRA.Platforms.Default VerifyThreadAffinity(); return new Shader(name); } + + public string GLVersion { get { return OpenGL.Version; } } } } diff --git a/OpenRA.Platforms.Null/NullGraphicsDevice.cs b/OpenRA.Platforms.Null/NullGraphicsDevice.cs index af20d804eb..3535d97eeb 100644 --- a/OpenRA.Platforms.Null/NullGraphicsDevice.cs +++ b/OpenRA.Platforms.Null/NullGraphicsDevice.cs @@ -60,6 +60,8 @@ namespace OpenRA.Platforms.Null public IHardwareCursor CreateHardwareCursor(string name, Size size, byte[] data, int2 hotspot) { return null; } public void SetHardwareCursor(IHardwareCursor cursor) { } + + public string GLVersion { get { return "(null)"; } } } public class NullShader : IShader