예제 #1
0
        /// <summary>
        /// Initializes the game.
        /// </summary>
        protected override void Initialize()
        {
            Logger.Trace("init()");
            this.Window.Title = "Voxeliq Client " + Assembly.GetExecutingAssembly().GetName().Version;

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

            this.AddComponents(); // add the game compontents.

            base.Initialize();
        }
예제 #2
0
        /// <summary>
        /// Initializes the game.
        /// </summary>
        protected override void Initialize()
        {
            Logger.Trace("init()"); // log the init.
            this.Window.Title = string.Format("Voxeliq [{0}/{1}]", PlatformInfo.GameFramework, PlatformInfo.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,
                    LenghtInBlocks = 16,
                },
                Cache =
                {
                    CacheExtraChunks = true,
                    ViewRange = 8,
                    CacheRange = 12,
                },
                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.Default,
                },
                Audio =
                {
                    Enabled = audioSettings.Enabled,
                }
            };

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

            engine.EngineStart += OnEngineStart;

            engine.Run();

            base.Initialize();
        }