Paradox Game Engine  v1.0.0 beta06
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros Pages
GraphicsProfileHelper.cs
Go to the documentation of this file.
1 // Copyright (c) 2014 Silicon Studio Corp. (http://siliconstudio.co.jp)
2 // This file is distributed under GPL v3. See LICENSE.md for details.
3 #if SILICONSTUDIO_PARADOX_GRAPHICS_API_DIRECT3D
4 using SharpDX.Direct3D;
5 
6 namespace SiliconStudio.Paradox.Graphics
7 {
8  internal static class GraphicsProfileHelper
9  {
10  /// <summary>
11  /// Returns a GraphicsProfile from a FeatureLevel.
12  /// </summary>
13  /// <returns>associated GraphicsProfile</returns>
14  public static FeatureLevel[] ToFeatureLevel(this GraphicsProfile[] profiles)
15  {
16  if (profiles == null)
17  {
18  return null;
19  }
20 
21  var levels = new FeatureLevel[profiles.Length];
22  for (int i = 0; i < levels.Length; i++)
23  {
24  levels[i] = (FeatureLevel) profiles[i];
25  }
26  return levels;
27  }
28 
29  /// <summary>
30  /// Returns a GraphicsProfile from a FeatureLevel.
31  /// </summary>
32  /// <returns>associated GraphicsProfile</returns>
33  public static FeatureLevel ToFeatureLevel(this GraphicsProfile profile)
34  {
35  return (FeatureLevel)profile;
36  }
37 
38  /// <summary>
39  /// Returns a GraphicsProfile from a FeatureLevel.
40  /// </summary>
41  /// <param name="level">The level.</param>
42  /// <returns>associated GraphicsProfile</returns>
43  public static GraphicsProfile FromFeatureLevel(FeatureLevel level)
44  {
45  return (GraphicsProfile) level;
46  }
47  }
48 }
49 #endif
GraphicsProfile
Identifies the set of supported devices for the demo based on device capabilities.