示例#1
0
 public static void ShowScreen(this object sender, UIIDs id, IScreenSettings settings = null)
 {
     sender.SendGlobalEvent(new ShowWindowEvent
     {
         Id       = (ushort)id,
         Settings = settings
     });
 }
示例#2
0
        private void UpdateScreenSettings(IScreenSettings screenSettings)
        {
            var graphics = (GraphicsDeviceManager) _game.Services.GetService(typeof (IGraphicsDeviceManager));
            graphics.PreferredBackBufferHeight = screenSettings.Height;
            graphics.PreferredBackBufferWidth = screenSettings.Width;
            graphics.IsFullScreen = screenSettings.IsFullScreen;
            graphics.SynchronizeWithVerticalRetrace = screenSettings.SynchronizeWithVerticalRetrace;
            graphics.PreferMultiSampling = true;
            graphics.GraphicsDevice.PresentationParameters.MultiSampleCount = 4;

            var state = new RasterizerState
                {
                    CullMode = CullMode.CullCounterClockwiseFace,
                    MultiSampleAntiAlias = true
                };
            _game.GraphicsDevice.RasterizerState = state;
            graphics.ApplyChanges();
        }