anx.framework/ANX.Framework/Graphics/EffectPassCollection.cs

87 lines
2.3 KiB
C#
Raw Normal View History

#region Using Statements
2011-10-31 05:36:24 +00:00
using System;
using System.Collections.Generic;
using System.Collections;
using ANX.Framework.NonXNA;
2012-10-10 19:26:53 +00:00
using ANX.Framework.NonXNA.Development;
2011-10-31 05:36:24 +00:00
#endregion // Using Statements
// This file is part of the ANX.Framework created by the
// "ANX.Framework developer group" and released under the Ms-PL license.
// For details see: http://anxframework.codeplex.com/license
2011-10-31 05:36:24 +00:00
namespace ANX.Framework.Graphics
{
2012-10-10 19:26:53 +00:00
[PercentageComplete(100)]
[Developer("Glatzemann")]
[TestState(TestStateAttribute.TestState.Untested)]
2011-10-31 05:36:24 +00:00
public sealed class EffectPassCollection : IEnumerable<EffectPass>
{
#region Private Members
private Effect parentEffect;
private INativeEffect nativeEffect;
private INativeEffectTechnique parentTechnique;
private List<EffectPass> passes;
#endregion // Private Members
internal EffectPassCollection(Effect parentEffect, INativeEffect nativeEffect, INativeEffectTechnique parentTechnique)
{
this.parentEffect = parentEffect;
this.nativeEffect = nativeEffect;
this.parentTechnique = parentTechnique;
this.passes = new List<EffectPass>();
foreach (EffectPass pass in parentTechnique.Passes)
{
this.passes.Add(pass);
}
}
2011-10-31 05:36:24 +00:00
public EffectPass this[int index]
{
get
{
if (index >= passes.Count)
{
throw new ArgumentOutOfRangeException("index");
}
return passes[index];
2011-10-31 05:36:24 +00:00
}
}
public EffectPass this[string name]
{
get
{
throw new NotImplementedException();
}
}
2011-10-31 05:36:24 +00:00
IEnumerator<EffectPass> IEnumerable<EffectPass>.GetEnumerator()
{
return (IEnumerator<EffectPass>)this.passes.GetEnumerator();
}
2011-10-31 05:36:24 +00:00
IEnumerator IEnumerable.GetEnumerator()
{
return (IEnumerator)this.passes.GetEnumerator();
}
2011-10-31 05:36:24 +00:00
public List<EffectPass>.Enumerator GetEnumerator()
{
return this.passes.GetEnumerator();
}
2011-10-31 05:36:24 +00:00
public int Count
{
get
{
return this.passes.Count;
2011-10-31 05:36:24 +00:00
}
}
}
}