/// <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 = GraphicsDevice.Platform != GraphicsPlatform.Vulkan;
            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;
        }
Exemple #2
0
 protected GamePlatform(GameBase game)
 {
     this.game = game;
     Services  = game.Services;
 }
 public GamePlatformAndroid(GameBase game) : base(game)
 {
     PopulateFullName();
 }
Exemple #4
0
 public GamePlatformOpenTK(GameBase game) : base(game)
 {
 }
Exemple #5
0
 public GamePlatformiOS(GameBase game) : base(game)
 {
     PopulateFullName();
 }