forked from MonoGame/MonoGame
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTargetPlatform.cs
More file actions
126 lines (107 loc) · 3 KB
/
Copy pathTargetPlatform.cs
File metadata and controls
126 lines (107 loc) · 3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
// MonoGame - Copyright (C) MonoGame Foundation, Inc
// This file is subject to the terms and conditions defined in
// file 'LICENSE.txt', which is part of this source code package.
using System.ComponentModel;
using System.Globalization;
namespace Microsoft.Xna.Framework.Content.Pipeline
{
/// <summary>
/// Identifiers for the target platform.
/// </summary>
[TypeConverter(typeof(TargetPlatformTypeConverter))]
public enum TargetPlatform
{
/// <summary>
/// All desktop versions of Windows using DirectX.
/// </summary>
Windows,
/// <summary>
/// Xbox 360 video game and entertainment system
/// </summary>
Xbox360,
// MonoGame-specific platforms listed below
/// <summary>
/// Apple iOS-based devices (iPod Touch, iPhone, iPad)
/// (MonoGame)
/// </summary>
iOS,
/// <summary>
/// Android-based devices
/// (MonoGame)
/// </summary>
Android,
/// <summary>
/// All desktop versions using OpenGL.
/// (MonoGame)
/// </summary>
DesktopGL,
/// <summary>
/// Apple Mac OSX-based devices (iMac, MacBook, MacBook Air, etc)
/// (MonoGame)
/// </summary>
MacOSX,
/// <summary>
/// Google Chrome Native Client
/// (MonoGame)
/// </summary>
NativeClient,
/// <summary>
/// Raspberry Pi
/// (MonoGame)
/// </summary>
RaspberryPi,
/// <summary>
/// Sony PlayStation4
/// </summary>
PlayStation4,
/// <summary>
/// Sony PlayStation5
/// </summary>
PlayStation5,
/// <summary>
/// Xbox One
/// </summary>
XboxOne,
/// <summary>
/// Nintendo Switch
/// </summary>
Switch,
/// <summary>
/// WebAssembly and Bridge.NET
/// </summary>
Web,
/// <summary>
/// All desktop versions using Vulkan.
/// </summary>
DesktopVK,
/// <summary>
/// Windows using DirectX 12
/// </summary>
WindowsDX12,
/// <summary>
/// Xbox Series S|X
/// </summary>
XboxSeries
}
/// <summary>
/// Deserialize legacy Platforms from .MGCB files.
/// </summary>
internal class TargetPlatformTypeConverter(Type type) : EnumConverter(type)
{
public override object? ConvertFrom(ITypeDescriptorContext? context, CultureInfo? culture, object value)
{
try
{
return base.ConvertFrom(context, culture, value);
}
catch (FormatException)
{
// convert legacy Platforms
if (value.Equals("Linux") || value.Equals("WindowsGL"))
return TargetPlatform.DesktopGL;
else
throw;
}
}
}
}