상속: IGameService
예제 #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
 /// <summary>
 /// The on initialize.
 /// </summary>
 /// <param name="launchParameters">
 /// The launch parameters.
 /// </param>
 /// <returns>
 /// The <see cref="EngineConfiguration"/>.
 /// </returns>
 public override EngineConfiguration OnInitialize(LaunchParameters launchParameters)
 {
     this.GameComponentManager.Add(this.SceneManager);
     return new EngineConfiguration(new DirectXRenderDevice() , new WaveOutInitializer());
 }
예제 #3
0
        public override EngineConfiguration OnInitialize(LaunchParameters launchParameters)
        {
            this.GameComponentManager.Add(this.SceneManager);

            return new EngineConfiguration(new Rendering.DirectX11.DirectXGraphicsManager());
        }
예제 #4
0
파일: Game.cs 프로젝트: ThuCommix/Sharpex2D
 /// <summary>
 /// Restarts the Game with the specified LaunchParameters.
 /// </summary>
 /// <param name="launchParameters">The LaunchParameters.</param>
 public void Restart(LaunchParameters launchParameters)
 {
     SGL.Restart(launchParameters.ToString());
 }
예제 #5
0
파일: Game.cs 프로젝트: ThuCommix/Sharpex2D
 /// <summary>
 /// Processes the Game initialization.
 /// </summary>
 /// <param name="launchParameters">The LaunchParameters.</param>
 public abstract EngineConfiguration OnInitialize(LaunchParameters launchParameters);
예제 #6
0
 /// <summary>
 /// Initializes the game.
 /// </summary>
 /// <param name="launchParameters">The LaunchParameters.</param>
 /// <returns>EngineConfiguration.</returns>
 public override EngineConfiguration OnInitialize(LaunchParameters launchParameters)
 {
     return new EngineConfiguration(new OpenGLGraphicsManager(), new WaveOutInitializer());
 }