Example #1
0
        protected override void Initialize()
        {
            Window.Title = $"Alex - {VersionUtils.GetVersion()} - {RenderingEngine}";

            // InitCamera();
            this.Window.TextInput += Window_TextInput;

            if (!RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
            {
                var currentAdapter = GraphicsAdapter.Adapters.FirstOrDefault(x => x == GraphicsDevice.Adapter);

                if (currentAdapter != null)
                {
                    if (currentAdapter.IsProfileSupported(GraphicsProfile.HiDef))
                    {
                        DeviceManager.GraphicsProfile = GraphicsProfile.HiDef;
                    }
                }
            }

            base.InactiveSleepTime = TimeSpan.Zero;

            GraphicsDevice.PresentationParameters.MultiSampleCount = 8;

            DeviceManager.ApplyChanges();

            base.Initialize();

            RichPresenceProvider.Initialize();
        }
Example #2
0
        protected override void Initialize()
        {
            Window.Title = "Alex - " + Version;

            // InitCamera();
            this.Window.TextInput += Window_TextInput;

            if (!RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
            {
                var currentAdapter = GraphicsAdapter.Adapters.FirstOrDefault(x => x == GraphicsDevice.Adapter);

                if (currentAdapter != null)
                {
                    if (currentAdapter.IsProfileSupported(GraphicsProfile.HiDef))
                    {
                        DeviceManager.GraphicsProfile = GraphicsProfile.HiDef;
                    }
                }
            }

            GraphicsDevice.PresentationParameters.MultiSampleCount = 8;

            DeviceManager.ApplyChanges();

            base.Initialize();

            RichPresenceProvider.Initialize();
        }
Example #3
0
 private void SetVSync(bool enabled)
 {
     UIThreadQueue.Enqueue(() =>
     {
         base.IsFixedTimeStep = enabled;
         DeviceManager.SynchronizeWithVerticalRetrace = enabled;
         DeviceManager.ApplyChanges();
     });
 }
Example #4
0
        private void SetAntiAliasing(bool enabled, int count)
        {
            UIThreadQueue.Enqueue(() =>
            {
                DeviceManager.PreferMultiSampling = enabled;
                GraphicsDevice.PresentationParameters.MultiSampleCount = count;

                DeviceManager.ApplyChanges();
            });
        }
Example #5
0
        protected override void Initialize()
        {
            GameInstanceProvider.SetInstance(this);
            ComponentManager.LoadComponents();

            DeviceManager.PreferredBackBufferWidth  = RENDER_WIDTH;
            DeviceManager.PreferredBackBufferHeight = RENDER_HEIGHT;
            DeviceManager.ApplyChanges();

            base.Initialize();
        }
Example #6
0
        /// <summary>
        /// Changes the game to full screen.
        /// </summary>
        public void FullScreen()
        {
            if (ViewChanged != null)
            {
                PreviousViewportSize = new Vector2(Viewport.Width, Viewport.Height);

                DeviceManager.IsFullScreen = true;
                DeviceManager.ApplyChanges();

                if (ViewChanged != null)
                {
                    ViewChanged();
                }
            }
        }
Example #7
0
        protected override void Initialize()
        {
            Window.Title = "Alex - " + Version;

            // InitCamera();
            this.Window.TextInput += Window_TextInput;

            var currentAdapter = GraphicsAdapter.Adapters.FirstOrDefault(x => x == GraphicsDevice.Adapter);

            if (currentAdapter != null)
            {
                if (currentAdapter.IsProfileSupported(GraphicsProfile.HiDef))
                {
                    DeviceManager.GraphicsProfile = GraphicsProfile.HiDef;
                }
            }

            DeviceManager.ApplyChanges();

            base.Initialize();
        }
Example #8
0
 /// <summary>
 /// Changes the game to full screen.
 /// </summary>
 public static void FullScreen()
 {
     DeviceManager.IsFullScreen = true;
     DeviceManager.ApplyChanges();
 }