Viewport.cs 679 B

1234567891011121314151617181920212223242526
  1. namespace Urho
  2. {
  3. partial class Viewport
  4. {
  5. public Viewport(Scene scene, Camera camera, RenderPath renderPath)
  6. : this(Application.CurrentContext, scene, camera, renderPath) {}
  7. public Viewport(Scene scene, Camera camera, Urho.IntRect rect, RenderPath renderPath)
  8. : this(Application.CurrentContext, scene, camera, rect, renderPath) {}
  9. public unsafe void SetClearColor(Color color)
  10. {
  11. Runtime.ValidateRefCounted(this);
  12. var rp = RenderPath;
  13. for (int i = 0; i < rp.NumCommands; i++)
  14. {
  15. var cmd = rp.GetCommand((uint)i);
  16. if (cmd->Type == RenderCommandType.Clear)
  17. {
  18. cmd->UseFogColor = 0;
  19. cmd->ClearColor = color;
  20. }
  21. }
  22. }
  23. }
  24. }