コード例 #1
0
        void DrawLights()
        {
            lightingTarget.Begin();
            Common.Device.Clear(Color.Transparent);

            Vector2 gdSize = new Vector2(Common.ScreenResolution.Y,
                                         Common.ScreenResolution.X) * CameraManager.CurrentCamera.InverseZoom;

            DrawPointLights(gdSize);
            DrawDominateLights();

            lightingTarget.End();
        }
コード例 #2
0
        void Draw(DrawingStage stage)
        {
            Common.Device.BlendState = BlendState.AlphaBlend;

            switch (stage)
            {
            case DrawingStage.Colour:
                render.Begin();
                break;

            case DrawingStage.Distortion:
                distortionRender.Begin();
                break;

            default:
                opaqueRender.Begin();
                break;
            }

            Common.Device.Clear(Color.Transparent);

            if (CameraManager.CurrentCamera != null)
            {
                Common.Batch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend, SamplerState.PointClamp,
                                   null, null, null, CameraManager.CurrentCamera.ViewMatrix);
            }
            else
            {
                Common.Batch.Begin();
            }

            layers.Draw(stage);

            Common.Batch.End();

            switch (stage)
            {
            case DrawingStage.Colour:
                render.End();
                break;

            case DrawingStage.Distortion:
                distortionRender.End();
                break;

            default:
                opaqueRender.End();
                break;
            }
        }
コード例 #3
0
        public void PostRender()
        {
            if (layers.Layers > 0)
            {
                render.Begin();

                Common.Device.Clear(Color.Transparent);

                Common.Batch.Begin();
                layers.Draw(DrawingStage.Colour);
                Common.Batch.End();
                render.End();

                final = render.Texture;
            }
            else
            {
                final = blank;
            }
        }