#region CPL License /* Nuclex Framework Copyright (C) 2002-2009 Nuclex Development Labs This library is free software; you can redistribute it and/or modify it under the terms of the IBM Common Public License as published by the IBM Corporation; either version 1.0 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the IBM Common Public License for more details. You should have received a copy of the IBM Common Public License along with this library */ #endregion using System; using System.Collections.Generic; using Microsoft.Xna.Framework.Graphics; namespace Nuclex.Graphics.Batching { /// /// Controls the graphics device settings during the rendering process /// public abstract class DrawContext { /// Number of passes this draw context requires for rendering public abstract int Passes { get; } /// Prepares the graphics device for drawing /// Index of the pass to begin rendering public abstract void Apply(int pass); /// Tests whether another draw context is identical to this one /// Other context to check for equality /// True if the other context is identical to this one public abstract bool Equals(DrawContext otherContext); /// /// Tests whether another object is a draw context with identical settings /// /// Object to check for equality /// /// True if the other context is a draw context identical to this one /// public override bool Equals(object other) { DrawContext drawContext = other as DrawContext; if(drawContext != null) return Equals(drawContext); else return false; } /// /// Returns a hashcode that is not guaranteed to be unique but will be equal for /// all instances of the class that are in an identical state /// /// The hashcode of the object public override int GetHashCode() { return base.GetHashCode(); } } } // namespace Nuclex.Graphics.Batching