예제 #1
0
        /// <summary>
        /// Allows the game to perform any initialization it needs to before starting to run.
        /// This is where it can query for any required services and load any non-graphic
        /// related content.  Calling base.Initialize will enumerate through any components
        /// and initialize them as well.
        /// </summary>
        protected override void Initialize()
        {
            // Set mouse visible
            IsMouseVisible = true;

            // Set the window title
            Window.Title = "Project Aona Test";

            // Spritebatch
            _spriteBatch = new SpriteBatch(GraphicsDevice);

            // Initialize the configurations
            EngineConfig config = new EngineConfig();

            // Create the engine
            _engine = new Engine.Core.Engine(this, config, _spriteBatch);

            // Start the screen manager
            GraphicsManager = new GraphicsManager(_graphicsDeviceManager, this);

            // Add the engine listener
            _engine.EngineStart += OnEngineStart;

            // Start the engine
            _engine.Run();

            IsFixedTimeStep = false; // TODO: Remove?

            base.Initialize();
        }
예제 #2
0
파일: Program.cs 프로젝트: Dotoks/Softuni
 static void Main(string[] args)
 {
     Engine.Core.Engine engine = new Engine.Core.Engine();
     engine.Run();
 }
예제 #3
0
        /// <summary>
        /// Initializes the game.
        /// </summary>
        protected override void Initialize()
        {
            Logger.Trace("init()"); // log the init.
            this.Window.Title = string.Format("Voxeliq [{0}/{1}]", PlatformManager.GameFramework, PlatformManager.GraphicsApi); // set the window title.

            this.IsMouseVisible = false;

            // read settings.
            var audioSettings = new AudioSettings();
            var graphicsSettings = new GraphicsSettings();

            // create a new engine configuration.
            var config = new EngineConfig
            {
                Chunk =
                {
                    WidthInBlocks = 16,
                    HeightInBlocks = 128,
                    LengthInBlocks = 16,
                },
                Cache =
                {
                    CacheExtraChunks = true,
                    ViewRange = 12,
                    CacheRange = 16,
                },
                Graphics =
                {
                    Width = graphicsSettings.Width,
                    Height = graphicsSettings.Height,
                    FullScreenEnabled = graphicsSettings.FullScreenEnabled,
                    VerticalSyncEnabled = graphicsSettings.VerticalSyncEnabled,
                    FixedTimeStepsEnabled = graphicsSettings.FixedTimeStepsEnabled,
                },
                World =
                {
                    IsInfinitive = true,
                },
                Debugging =
                {
                    GraphsEnabled = true,
                },
                Bloom =
                {
                    Enabled = false,
                    State = BloomState.Saturated,
                },
                Audio =
                {
                    Enabled = audioSettings.Enabled,
                }
            };

            var engine = new Engine.Core.Engine(this, config);
            this.ScreenManager = new GraphicsManager(this._graphicsDeviceManager, this); // start the screen manager.

            engine.EngineStart += OnEngineStart;

            engine.Run();

            base.Initialize();
        }
예제 #4
0
파일: GameClient.cs 프로젝트: su636/voxeliq
        /// <summary>
        /// Initializes the game.
        /// </summary>
        protected override void Initialize()
        {
            Logger.Trace("init()");                                                                                             // log the init.
            this.Window.Title = string.Format("Voxeliq [{0}/{1}]", PlatformManager.GameFramework, PlatformManager.GraphicsApi); // set the window title.

            this.IsMouseVisible = false;

            // read settings.
            var audioSettings    = new AudioSettings();
            var graphicsSettings = new GraphicsSettings();

            // create a new engine configuration.
            var config = new EngineConfig
            {
                Chunk =
                {
                    WidthInBlocks  =  16,
                    HeightInBlocks = 128,
                    LengthInBlocks =  16,
                },
                Cache =
                {
                    CacheExtraChunks = true,
                    ViewRange        =   12,
                    CacheRange       =   16,
                },
                Graphics =
                {
                    Width                 = graphicsSettings.Width,
                    Height                = graphicsSettings.Height,
                    FullScreenEnabled     = graphicsSettings.FullScreenEnabled,
                    VerticalSyncEnabled   = graphicsSettings.VerticalSyncEnabled,
                    FixedTimeStepsEnabled = graphicsSettings.FixedTimeStepsEnabled,
                },
                World =
                {
                    IsInfinitive = true,
                },
                Debugging =
                {
                    GraphsEnabled = true,
                },
                Bloom =
                {
                    Enabled = false,
                    State   = BloomState.Saturated,
                },
                Audio =
                {
                    Enabled = audioSettings.Enabled,
                }
            };

            var engine = new Engine.Core.Engine(this, config);

            this.ScreenManager = new GraphicsManager(this._graphicsDeviceManager, this); // start the screen manager.

            engine.EngineStart += OnEngineStart;

            engine.Run();

            base.Initialize();
        }