From 71178dc9afea74e2f54fbe23c42100fd8be3f948 Mon Sep 17 00:00:00 2001 From: Nikos Kastellanos Date: Mon, 29 Apr 2024 08:28:44 +0300 Subject: [PATCH] remove static PlatformInfo, Obsolete MonoGamePlatform and Obsolete GraphicsBackend (#1519) --- .../MonoGame.Framework.Common.targets | 3 - .../Utilities/GraphicsBackend.cs | 32 --------- .../Utilities/MonoGamePlatform.cs | 72 ------------------- MonoGame.Framework/Utilities/PlatformInfo.cs | 66 ----------------- .../XNA.Framework.Android.Xamarin.csproj | 3 - .../XNA.Framework.DesktopGL.csproj | 3 - MonoGame.Framework/XNA.Framework.UAP.csproj | 3 - .../XNA.Framework.WindowsDX11.csproj | 3 - .../XNA.Framework.iOS.Xamarin.csproj | 3 - 9 files changed, 188 deletions(-) delete mode 100644 MonoGame.Framework/Utilities/GraphicsBackend.cs delete mode 100644 MonoGame.Framework/Utilities/MonoGamePlatform.cs delete mode 100644 MonoGame.Framework/Utilities/PlatformInfo.cs diff --git a/MonoGame.Framework/MonoGame.Framework.Common.targets b/MonoGame.Framework/MonoGame.Framework.Common.targets index cd038cd1816..2b0fc05d36c 100644 --- a/MonoGame.Framework/MonoGame.Framework.Common.targets +++ b/MonoGame.Framework/MonoGame.Framework.Common.targets @@ -10,10 +10,7 @@ - - - diff --git a/MonoGame.Framework/Utilities/GraphicsBackend.cs b/MonoGame.Framework/Utilities/GraphicsBackend.cs deleted file mode 100644 index 44849eef9bb..00000000000 --- a/MonoGame.Framework/Utilities/GraphicsBackend.cs +++ /dev/null @@ -1,32 +0,0 @@ -// MonoGame - Copyright (C) The MonoGame Team -// This file is subject to the terms and conditions defined in -// file 'LICENSE.txt', which is part of this source code package. - -namespace MonoGame.Framework.Utilities -{ - /// - /// Type of the underlying graphics backend. - /// - public enum GraphicsBackend - { - /// - /// Represents the Microsoft DirectX graphics backend. - /// - DirectX, - - /// - /// Represents the OpenGL graphics backend. - /// - OpenGL, - - /// - /// Represents the Vulkan graphics backend. - /// - Vulkan, - - /// - /// Represents the Apple Metal graphics backend. - /// - Metal - } -} \ No newline at end of file diff --git a/MonoGame.Framework/Utilities/MonoGamePlatform.cs b/MonoGame.Framework/Utilities/MonoGamePlatform.cs deleted file mode 100644 index f6f33093daf..00000000000 --- a/MonoGame.Framework/Utilities/MonoGamePlatform.cs +++ /dev/null @@ -1,72 +0,0 @@ -// MonoGame - Copyright (C) The MonoGame Team -// This file is subject to the terms and conditions defined in -// file 'LICENSE.txt', which is part of this source code package. - -namespace MonoGame.Framework.Utilities -{ - /// - /// Type of the underlying game platform. - /// - public enum MonoGamePlatform - { - /// - /// MonoGame Android platform. - /// - Android, - - /// - /// MonoGame iOS platform. - /// - iOS, - - /// - /// MonoGame tvOS platform. - /// - tvOS, - - /// - /// MonoGame cross platform desktop OpenGL platform. - /// - DesktopGL, - - /// - /// MonoGame Win32 Windows platform. - /// - Windows, - - /// - /// MonoGame Windows universal platform. - /// - WindowsUniversal, - - /// - /// MonoGame WebGL platform. - /// - WebGL, - - /// - /// BlazorGL webassembly platform. - /// - BlazorGL, - - /// - /// MonoGame Xbox One platform. - /// - XboxOne, - - /// - /// MonoGame PlayStation 4 platform. - /// - PlayStation4, - - /// - /// MonoGame PlayStation 5 platform. - /// - PlayStation5, - - /// - /// MonoGame Nintendo Switch platform. - /// - NintendoSwitch, - } -} diff --git a/MonoGame.Framework/Utilities/PlatformInfo.cs b/MonoGame.Framework/Utilities/PlatformInfo.cs deleted file mode 100644 index 3c68e12c810..00000000000 --- a/MonoGame.Framework/Utilities/PlatformInfo.cs +++ /dev/null @@ -1,66 +0,0 @@ -// MonoGame - Copyright (C) The MonoGame Team -// This file is subject to the terms and conditions defined in -// file 'LICENSE.txt', which is part of this source code package. - -using System; - -namespace MonoGame.Framework.Utilities -{ - /// - /// Utility class that returns information about the underlying platform - /// - public static class PlatformInfo - { - /// - /// Underlying game platform type - /// - [Obsolete("Use TitleContainer.Platform")] // marked obsolete after v3.10 - public static MonoGamePlatform MonoGamePlatform - { - get - { -#if ANDROID - return MonoGamePlatform.Android; -#elif DESKTOPGL - return MonoGamePlatform.DesktopGL; -#elif IOS - return MonoGamePlatform.iOS; -#elif TVOS - return MonoGamePlatform.tvOS; -#elif BLAZORGL - return MonoGamePlatform.BlazorGL; -#elif WINDOWSDX - return MonoGamePlatform.Windows; -#elif UAP || WINUI - return MonoGamePlatform.WindowsUniversal; -#elif SWITCH - return MonoGamePlatform.NintendoSwitch; -#elif XB1 - return MonoGamePlatform.XboxOne; -#elif PLAYSTATION4 - return MonoGamePlatform.PlayStation4; -#elif PLAYSTATION5 - return MonoGamePlatform.PlayStation5; -#elif REF - throw new PlatformNotSupportedException(); -#endif - } - } - - /// - /// Graphics backend - /// - [Obsolete("Use Adapter.Backend")] // marked obsolete after v3.10 - public static GraphicsBackend GraphicsBackend - { - get - { -#if DIRECTX - return GraphicsBackend.DirectX; -#else - return GraphicsBackend.OpenGL; -#endif - } - } - } -} diff --git a/MonoGame.Framework/XNA.Framework.Android.Xamarin.csproj b/MonoGame.Framework/XNA.Framework.Android.Xamarin.csproj index 9b7397de97b..1ef9b7b774f 100644 --- a/MonoGame.Framework/XNA.Framework.Android.Xamarin.csproj +++ b/MonoGame.Framework/XNA.Framework.Android.Xamarin.csproj @@ -282,9 +282,6 @@ Utilities\StbImageWriteSharp\StbImageWrite.Generated.cs - - - diff --git a/MonoGame.Framework/XNA.Framework.DesktopGL.csproj b/MonoGame.Framework/XNA.Framework.DesktopGL.csproj index d72e6d9cd0b..75283e008fc 100644 --- a/MonoGame.Framework/XNA.Framework.DesktopGL.csproj +++ b/MonoGame.Framework/XNA.Framework.DesktopGL.csproj @@ -327,9 +327,6 @@ Platform\Utilities\NVorbis\Ogg\OggPageFlags.cs - - - diff --git a/MonoGame.Framework/XNA.Framework.UAP.csproj b/MonoGame.Framework/XNA.Framework.UAP.csproj index a2a8674862a..b6cebfbd554 100644 --- a/MonoGame.Framework/XNA.Framework.UAP.csproj +++ b/MonoGame.Framework/XNA.Framework.UAP.csproj @@ -265,9 +265,6 @@ Utilities\StbImageWriteSharp\StbImageWrite.Generated.cs - - - diff --git a/MonoGame.Framework/XNA.Framework.WindowsDX11.csproj b/MonoGame.Framework/XNA.Framework.WindowsDX11.csproj index 3731534f354..5f6780a0d6d 100644 --- a/MonoGame.Framework/XNA.Framework.WindowsDX11.csproj +++ b/MonoGame.Framework/XNA.Framework.WindowsDX11.csproj @@ -248,9 +248,6 @@ Utilities\StbImageWriteSharp\StbImageWrite.Generated.cs - - - diff --git a/MonoGame.Framework/XNA.Framework.iOS.Xamarin.csproj b/MonoGame.Framework/XNA.Framework.iOS.Xamarin.csproj index 4cc7f77d2a5..17ca74acbb9 100644 --- a/MonoGame.Framework/XNA.Framework.iOS.Xamarin.csproj +++ b/MonoGame.Framework/XNA.Framework.iOS.Xamarin.csproj @@ -251,9 +251,6 @@ Utilities\StbImageWriteSharp\StbImageWrite.Generated.cs - - -