Beispiel #1
0
        public static void Draw(SpriteBatch SB, GraphicsDevice GD)
        {
            for (int i = 0; i < LightSourceList.Count; i++)
            {
                LightMapList.Add(LightSourceList[i].DrawLightmap(SB));
            }

            GD.SetRenderTarget(null);
            GD.Clear(Color.Black);
            SB.Begin();
            int RayCounter = 0;

            Assets.Blur.CurrentTechnique.Passes[0].Apply();
            for (int i = 0; i < LightSourceList.Count; i++)
            {
                RayCounter += LightSourceList[i].RayList.Count;
                if (!IsOverlapped(LightSourceList[i].Pos))
                {
                    SB.Draw(LightMapList[i], new Rectangle(0, 0, (int)Values.WindowSize.X, (int)Values.WindowSize.Y), Color.White * 0.5f);
                }
            }
            LightMapList.Clear();
            SB.DrawString(Assets.Font, "Total Rays: " + RayCounter.ToString(), new Vector2(12, 12), Color.White);
            FPSCounter.Draw(SB);
            SB.End();
        }
Beispiel #2
0
        protected override void Update(GameTime gameTime)
        {
            Control.Update();
            FPSCounter.Update(gameTime);

            if (Control.CurKS.IsKeyDown(Keys.Escape))
            {
                Exit();
            }

            Timer += 1;

            Master.Update();

            base.Update(gameTime);
        }