23 #if SILICONSTUDIO_PLATFORM_WINDOWS_RUNTIME
24 using System.Collections.Generic;
26 using SiliconStudio.Paradox.Graphics;
27 using Windows.ApplicationModel;
29 namespace SiliconStudio.
Paradox.Games
31 internal class GamePlatformWindowsRuntime : GamePlatform
33 public GamePlatformWindowsRuntime(GameBase game) : base(game)
37 public override string DefaultAppDirectory
41 return Package.Current.InstalledLocation.Path;
45 internal override GameWindow[] GetSupportedGameWindows()
47 return new GameWindow[]
49 new GameWindowWindowsRuntimeSwapChainPanel(),
53 public override List<GraphicsDeviceInformation> FindBestDevices(GameGraphicsParameters preferredParameters)
55 var graphicsDeviceInfos = base.FindBestDevices(preferredParameters);
58 if (graphicsDeviceInfos.Count == 0)
60 var graphicsAdapter = GraphicsAdapterFactory.Adapters[0];
63 foreach (var featureLevel
in preferredParameters.PreferredGraphicsProfile)
66 if (graphicsAdapter.IsProfileSupported(featureLevel))
68 var deviceInfo =
new GraphicsDeviceInformation
70 Adapter = graphicsAdapter,
72 PresentationParameters =
74 MultiSampleCount = MSAALevel.None,
75 IsFullScreen = preferredParameters.IsFullScreen,
76 PresentationInterval = preferredParameters.SynchronizeWithVerticalRetrace ? PresentInterval.One : PresentInterval.Immediate,
77 DeviceWindowHandle = MainWindow.NativeWindow,
85 var displayMode =
new DisplayMode(
PixelFormat.B8G8R8A8_UNorm, gameWindow.ClientBounds.Width, gameWindow.ClientBounds.Height,
new Rational(60, 1));
86 AddDevice(displayMode, deviceInfo, preferredParameters, graphicsDeviceInfos);
94 return graphicsDeviceInfos;
GraphicsProfile
Identifies the set of supported devices for the demo based on device capabilities.
PixelFormat
Defines various types of pixel formats.