/// <summary>
        /// Initializes a new instance of the <see cref="GraphicsDeviceManager" /> class.
        /// </summary>
        /// <param name="game">The game.</param>
        /// <exception cref="System.ArgumentNullException">The game instance cannot be null.</exception>
        internal GraphicsDeviceManager(GameBase game)
        {
            this.game = game;
            if (this.game == null)
            {
                throw new ArgumentNullException("game");
            }

            lockDeviceCreation = new object();

            // Defines all default values
            SynchronizeWithVerticalRetrace = true;
            PreferredColorSpace            = ColorSpace.Linear;
            PreferredBackBufferFormat      = PixelFormat.R8G8B8A8_UNorm;
            PreferredDepthStencilFormat    = PixelFormat.D24_UNorm_S8_UInt;
            preferredBackBufferWidth       = DefaultBackBufferWidth;
            preferredBackBufferHeight      = DefaultBackBufferHeight;
            preferredRefreshRate           = new Rational(60, 1);
            PreferredMultisampleCount      = MultisampleCount.None;
            PreferredGraphicsProfile       = new[]
            {
                GraphicsProfile.Level_11_1,
                GraphicsProfile.Level_11_0,
                GraphicsProfile.Level_10_1,
                GraphicsProfile.Level_10_0,
                GraphicsProfile.Level_9_3,
                GraphicsProfile.Level_9_2,
                GraphicsProfile.Level_9_1,
            };

            graphicsDeviceFactory = game.Services.GetService <IGraphicsDeviceFactory>();
            if (graphicsDeviceFactory == null)
            {
                throw new InvalidOperationException("IGraphicsDeviceFactory is not registered as a service");
            }

            game.WindowCreated += GameOnWindowCreated;
        }
 protected GamePlatform(GameBase game)
 {
     this.game = game;
     Services  = game.Services;
 }
 public GamePlatformOpenTK(GameBase game) : base(game)
 {
 }
Esempio n. 4
0
 public GamePlatformiOS(GameBase game) : base(game)
 {
     PopulateFullName();
 }
 public GamePlatformAndroid(GameBase game) : base(game)
 {
     PopulateFullName();
 }
Esempio n. 6
0
 public static GamePlatform Create(GameBase game)
 {
     // Here we cover all Desktop variants: WinForms, WPF,...
     return(new GamePlatformDesktop(game));
 }