/// <summary> /// Indicates whether the current object is equal to another object of the same type. /// </summary> /// <param name="other"> /// A <see cref="GraphicsState"/> to compare to this GraphicsState. /// </param> /// <returns> /// It returns true if the current object is equal to <paramref name="other"/>. /// </returns> /// <remarks> /// <para> /// This method test only whether <paramref name="other"/> type equals to this type. /// </para> /// </remarks> /// <exception cref="ArgumentNullException"> /// This exception is thrown if the parameter <paramref name="other"/> is null. /// </exception> public override bool Equals(IGraphicsState other) { if (base.Equals(other) == false) { return(false); } Debug.Assert(other is CullFaceState); CullFaceState otherState = (CullFaceState)other; if (otherState._FrontFaceMode != _FrontFaceMode) { return(false); } if (otherState._Enabled != _Enabled) { return(false); } if (otherState._CulledFace != _CulledFace) { return(false); } return(true); }
/// <summary> /// Merge this state with another one. /// </summary> /// <param name="state"> /// A <see cref="IGraphicsState"/> having the same <see cref="StateIdentifier"/> of this state. /// </param> public override void Merge(IGraphicsState state) { if (state == null) { throw new ArgumentNullException("state"); } CullFaceState otherState = state as CullFaceState; if (otherState == null) { throw new ArgumentException("not a CullFaceState", "state"); } _FrontFaceMode = otherState._FrontFaceMode; _Enabled = otherState._Enabled; _CulledFace = otherState._CulledFace; }