1 using System.Collections.Generic;
2 using Microsoft.Xna.Framework;
8 internal class TargetedGraphicsDeviceManager : GraphicsDeviceManager
10 private int target = 1;
12 public TargetedGraphicsDeviceManager( Game game,
int displayTarget )
15 target = displayTarget;
18 protected override void OnPreparingDeviceSettings(
object sender, PreparingDeviceSettingsEventArgs args )
21 args.GraphicsDeviceInformation.PresentationParameters.IsFullScreen =
false;
23 base.OnPreparingDeviceSettings( sender, args );
26 protected override void RankDevices( List<GraphicsDeviceInformation> foundDevices )
28 List<GraphicsDeviceInformation> removals =
new List<GraphicsDeviceInformation>();
29 for (
int i = 0; i < foundDevices.Count; i++ )
31 if ( !foundDevices[i].Adapter.DeviceName.Contains(
"DISPLAY" + target ) )
32 removals.Add( foundDevices[i] );
34 foreach ( GraphicsDeviceInformation info
in removals )
36 foundDevices.Remove( info );
39 base.RankDevices( foundDevices );