Microsoft.Xna.Framework.GraphicsDeviceManager.ApplyChanges C# (CSharp) Method

ApplyChanges() public method

public ApplyChanges ( ) : void
return void
        public void ApplyChanges() { }

Usage Example

コード例 #1
0
ファイル: Main.cs プロジェクト: Shmaug/Voxel-Generator
        public Main()
        {
            graphics = new GraphicsDeviceManager(this);
            Content.RootDirectory = "Content";

            graphics.PreferredBackBufferWidth = Window.ClientBounds.Width;
            graphics.PreferredBackBufferHeight = Window.ClientBounds.Height;
            graphics.PreferMultiSampling = true;
            graphics.ApplyChanges();

            Window.AllowUserResizing = true;
            Window.ClientSizeChanged += (object sender, EventArgs e) => {
                if (player != null && player.Camera != null)
                    player.Camera.AspectRatio = (float)Window.ClientBounds.Width / Window.ClientBounds.Height;

                graphics.PreferredBackBufferWidth = Window.ClientBounds.Width;
                graphics.PreferredBackBufferHeight = Window.ClientBounds.Height;
                graphics.ApplyChanges();

                if (world != null) {
                    world.sunRenderTarget = new RenderTarget2D(GraphicsDevice, Window.ClientBounds.Width, Window.ClientBounds.Height, false, GraphicsDevice.PresentationParameters.BackBufferFormat, GraphicsDevice.PresentationParameters.DepthStencilFormat);
                    world.postfxRenderTarget1 = new RenderTarget2D(GraphicsDevice, Window.ClientBounds.Width, Window.ClientBounds.Height, false, GraphicsDevice.PresentationParameters.BackBufferFormat, GraphicsDevice.PresentationParameters.DepthStencilFormat);
                    world.postfxRenderTarget2 = new RenderTarget2D(GraphicsDevice, Window.ClientBounds.Width, Window.ClientBounds.Height, false, GraphicsDevice.PresentationParameters.BackBufferFormat, GraphicsDevice.PresentationParameters.DepthStencilFormat);
                    world.sceneRenderTarget = new RenderTarget2D(GraphicsDevice, Window.ClientBounds.Width, Window.ClientBounds.Height, false, GraphicsDevice.PresentationParameters.BackBufferFormat, GraphicsDevice.PresentationParameters.DepthStencilFormat);
                }
            };

            ((System.Windows.Forms.Form)System.Windows.Forms.Form.FromChildHandle(Window.Handle)).WindowState = System.Windows.Forms.FormWindowState.Maximized;
        }
All Usage Examples Of Microsoft.Xna.Framework.GraphicsDeviceManager::ApplyChanges