// 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; using System.ComponentModel; using System.Globalization; namespace Microsoft.Xna.Framework.Content.Pipeline { /// /// Identifiers for the target platform. /// [TypeConverter(typeof(TargetPlatformTypeConverter))] public enum TargetPlatform { /// /// All desktop versions of Windows using DirectX. /// Windows, /// /// Xbox 360 video game and entertainment system /// Xbox360, // MonoGame-specific platforms listed below /// /// Apple iOS-based devices (iPod Touch, iPhone, iPad) /// (MonoGame) /// iOS, /// /// Android-based devices /// (MonoGame) /// Android, /// /// All desktop versions using OpenGL. /// (MonoGame) /// DesktopGL, /// /// Apple Mac OSX-based devices (iMac, MacBook, MacBook Air, etc) /// (MonoGame) /// MacOSX, /// /// Windows Store App /// (MonoGame) /// WindowsStoreApp, /// /// Google Chrome Native Client /// (MonoGame) /// NativeClient, /// /// Sony PlayStation Mobile (PS Vita) /// (MonoGame) /// [Obsolete("PlayStation Mobile is no longer supported")] PlayStationMobile, /// /// Windows Phone 8 /// (MonoGame) /// WindowsPhone8, /// /// Raspberry Pi /// (MonoGame) /// RaspberryPi, /// /// Sony PlayStation4 /// PlayStation4, /// /// PlayStation Vita /// PSVita, /// /// Xbox One /// XboxOne, /// /// Nintendo Switch /// Switch, } /// /// Deserialize legacy Platforms from .MGCB files. /// internal class TargetPlatformTypeConverter : EnumConverter { public TargetPlatformTypeConverter(Type type) : base(type) { } public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value) { try { return base.ConvertFrom(context, culture, value); } catch (FormatException fex) { // convert legacy Platforms if (value.Equals("Linux") || value.Equals("WindowsGL")) return TargetPlatform.DesktopGL; else throw fex; } } } }