Пример #1
0
        /// <summary>
        ///     Initializes the game.
        /// </summary>
        /// <param name="launchParameters">The LaunchParameters.</param>
        /// <returns>EngineConfiguration.</returns>
        public override EngineConfiguration OnInitialize(LaunchParameters launchParameters)
        {
            _resolution = "640x480";
            if (launchParameters.KeyAvailable("Resolution"))
            {
                _resolution = launchParameters["Resolution"];
            }

            var waveOutInitializer = new WaveOutInitializer();

            if (!waveOutInitializer.IsSupported)
            {
                MessageBox.Show("WaveOut wird nicht supported. Das Spiel wird ohne Ton gestartet.", "FlyingBird",
                                MessageBoxButtons.OK, MessageBoxIcon.Information);
            }

            if (launchParameters.KeyAvailable("Device"))
            {
                switch (launchParameters["Device"])
                {
                case "DirectX9":
                    _deviceHint = "DirectX9";
                    return(new EngineConfiguration(
                               new DirectXRenderDevice(),
                               waveOutInitializer.IsSupported ? waveOutInitializer : null));

                case "DirectX10":
                    _deviceHint = "DirectX10";
                    return(new EngineConfiguration(
                               new Sharpex2D.Rendering.DirectX10.DirectXRenderDevice(),
                               waveOutInitializer.IsSupported ? waveOutInitializer : null));

                case "DirectX11":
                    _deviceHint = "DirectX11";
                    return(new EngineConfiguration(
                               new Sharpex2D.Rendering.DirectX11.DirectXRenderDevice(),
                               waveOutInitializer.IsSupported ? waveOutInitializer : null));

                case "GDI+":
                    _deviceHint = "GDI+ :<(";
                    return(new EngineConfiguration(new GDIRenderDevice(),
                                                   waveOutInitializer.IsSupported ? waveOutInitializer : null));
                }
            }
            _deviceHint = "DirectX11";
            return(new EngineConfiguration(
                       new Sharpex2D.Rendering.DirectX11.DirectXRenderDevice(),
                       waveOutInitializer.IsSupported ? waveOutInitializer : null));
        }
Пример #2
0
        public override void Setup(LaunchParameters launchParameters)
        {
            if (launchParameters.KeyAvailable("Debugger") && launchParameters["Debugger"] == "Enabled")
            {
                Debugger.Launch();
            }
            GraphicsManager = new GLGraphicsManager
            {
                PreferredBackBufferHeight = 768,
                PreferredBackBufferWidth  = 768
            };
            var window = Get <GameWindow>();

            window.Title                 = "ChainReact - Development Build";
            Content.RootPath             = "Content";
            SoundManager                 = new WaveOutSoundManager();
            ResourceManager.SoundManager = SoundManager;
        }
Пример #3
0
 public override void Setup(LaunchParameters launchParameters)
 {
     if (launchParameters.KeyAvailable("Debugger") && launchParameters["Debugger"] == "Enabled")
     {
         Debugger.Launch();
     }
     GraphicsManager = new GLGraphicsManager
     {
         PreferredBackBufferHeight = 768,
         PreferredBackBufferWidth = 768
     };
     var window = Get<GameWindow>();
     window.Title = "ChainReact - Development Build";
     Content.RootPath = "Content";
     SoundManager = new WaveOutSoundManager();
     ResourceManager.SoundManager = SoundManager;
 }