Ejemplo n.º 1
0
 public void Render()
 {
     DirectX.BeginScene(0.75f, 0.75f, 0.75f, 1f);
     foreach (RenderableGameComponent item in _renderables)
     {
         if (item.BlendingEnabled)
         {
             DirectX.EnableAlphaBlending();
         }
         else
         {
             DirectX.DisableAlphaBlending();
         }
         if (item.DisplayWireframe)
         {
             DirectX.EnableWireFrame();
         }
         else
         {
             DirectX.DisableWireFrame();
         }
         if (item.ZBufferEnabled)
         {
             DirectX.EnableZBuffer();
             item.Render(DirectX.DeviceContext, Camera.ViewMatrix, DirectX.ProjectionMatrix);
         }
         else
         {
             DirectX.DisableZBuffer();
             item.Render(DirectX.DeviceContext, Camera.UiMatrix, DirectX.OrthoMatrix);
         }
     }
     DirectX.DrawScene();
 }