예제 #1
0
        public void Draw(World world)
        {
            if ((CurrentRenderTarget == null || CurrentRenderTarget == DrawBuffer) && _NeoManager.ShowSoftwareCursor && EngineVariables.EnableGUI)
            {
                _NeoManager.BeginDraw(DefaultGameTime);
                GraphicsDevice.SetRenderTarget(CurrentRenderTarget);
            }

            if (world != null)
            {
                BloomEffect.Visible = (BloomEnabled && world.Get <RenderSettings>().BloomEnabled);

                if (BloomEffect.Visible)
                {
                    BloomEffect.BeginDraw();
                    GraphicsDevice.Clear(Color.Black);
                    Stage = RenderStage.Bloom;

                    world.Draw(this);

                    BloomEffect.Draw(world.Get <RenderSettings>().BloomSettings);
                }

                GraphicsDevice.SetRenderTarget(CurrentRenderTarget);

                Stage = RenderStage.PreBloom;

                world.Draw(this);

                if (!BloomEffect.Visible)
                {
                    Stage = RenderStage.Bloom;

                    world.Draw(this);
                }
                else
                {
                    BloomEffect.Flush();
                }

                Stage = RenderStage.PostBloom;
                world.Draw(this);
            }

            if ((CurrentRenderTarget == null || CurrentRenderTarget == DrawBuffer) && _NeoManager.ShowSoftwareCursor && EngineVariables.EnableGUI)
            {
                _NeoManager.EndDraw();
            }

            GraphicsDevice.SetRenderTarget(null);
            GraphicsDevice.Clear(Color.Black);

            SpriteBatch.Begin(SpriteSortMode.Immediate, BlendState.Opaque, SamplerState.PointClamp, null, null, null, DisplaySettings.ScaleMatrix);
            GraphicsDevice.Viewport = DisplaySettings.Viewport;
            SpriteBatch.Draw(DrawBuffer, Vector2.Zero, Color.White);
            SpriteBatch.End();
        }