- Changed access modifiers in DisplayModeCollection to match Xna signature and fixed the usage of that class

- Implemented Properties of EffectParameter
- Fixed OutOfRange behaviour in multiple collection files in graphics to match xna behaviour (which just returns null)
- Implemented some methods in collection classes
This commit is contained in:
SND\AstrorEnales_cp 2012-10-13 10:51:27 +00:00 committed by Konstantin Koch
parent 085fb42ba6
commit db82358d24
27 changed files with 525 additions and 634 deletions

View File

@ -35,6 +35,11 @@ namespace ANX.Framework.Graphics
#endregion // Private Members
public static readonly BlendState Opaque;
public static readonly BlendState AlphaBlend;
public static readonly BlendState Additive;
public static readonly BlendState NonPremultiplied;
public BlendState()
{
this.nativeBlendState = AddInSystemFactory.Instance.GetDefaultCreator<IRenderSystemCreator>().CreateBlendState();
@ -53,11 +58,6 @@ namespace ANX.Framework.Graphics
this.MultiSampleMask = -1;
}
public static readonly BlendState Opaque;
public static readonly BlendState AlphaBlend;
public static readonly BlendState Additive;
public static readonly BlendState NonPremultiplied;
private BlendState(Blend sourceBlend, Blend destinationBlend, string name)
{
this.nativeBlendState = AddInSystemFactory.Instance.GetDefaultCreator<IRenderSystemCreator>().CreateBlendState();
@ -96,16 +96,10 @@ namespace ANX.Framework.Graphics
public BlendFunction AlphaBlendFunction
{
get
{
return this.alphaBlendFunction;
}
get { return this.alphaBlendFunction; }
set
{
if (this.nativeBlendState.IsBound)
{
throw new InvalidOperationException("You are not allowed to change BlendState properties while it is bound to the GraphicsDevice.");
}
ThrowIfBound();
this.alphaBlendFunction = value;
this.nativeBlendState.AlphaBlendFunction = value;
@ -114,16 +108,10 @@ namespace ANX.Framework.Graphics
public Blend AlphaDestinationBlend
{
get
{
return this.alphaDestinationBlend;
}
get { return this.alphaDestinationBlend; }
set
{
if (this.nativeBlendState.IsBound)
{
throw new InvalidOperationException("You are not allowed to change BlendState properties while it is bound to the GraphicsDevice.");
}
ThrowIfBound();
this.alphaDestinationBlend = value;
this.nativeBlendState.AlphaDestinationBlend = value;
@ -132,16 +120,10 @@ namespace ANX.Framework.Graphics
public Blend AlphaSourceBlend
{
get
{
return this.alphaSourceBlend;
}
get { return this.alphaSourceBlend; }
set
{
if (this.nativeBlendState.IsBound)
{
throw new InvalidOperationException("You are not allowed to change BlendState properties while it is bound to the GraphicsDevice.");
}
ThrowIfBound();
this.alphaSourceBlend = value;
this.nativeBlendState.AlphaSourceBlend = value;
@ -150,16 +132,10 @@ namespace ANX.Framework.Graphics
public Color BlendFactor
{
get
{
return this.blendFactor;
}
get { return this.blendFactor; }
set
{
if (this.nativeBlendState.IsBound)
{
throw new InvalidOperationException("You are not allowed to change BlendState properties while it is bound to the GraphicsDevice.");
}
ThrowIfBound();
this.blendFactor = value;
this.nativeBlendState.BlendFactor = value;
@ -168,16 +144,10 @@ namespace ANX.Framework.Graphics
public BlendFunction ColorBlendFunction
{
get
{
return this.colorBlendFunction;
}
get { return this.colorBlendFunction; }
set
{
if (this.nativeBlendState.IsBound)
{
throw new InvalidOperationException("You are not allowed to change BlendState properties while it is bound to the GraphicsDevice.");
}
ThrowIfBound();
this.colorBlendFunction = value;
this.nativeBlendState.ColorBlendFunction = value;
@ -186,16 +156,10 @@ namespace ANX.Framework.Graphics
public Blend ColorDestinationBlend
{
get
{
return this.colorDestinationBlend;
}
get { return this.colorDestinationBlend; }
set
{
if (this.nativeBlendState.IsBound)
{
throw new InvalidOperationException("You are not allowed to change BlendState properties while it is bound to the GraphicsDevice.");
}
ThrowIfBound();
this.colorDestinationBlend = value;
this.nativeBlendState.ColorDestinationBlend = value;
@ -204,16 +168,10 @@ namespace ANX.Framework.Graphics
public Blend ColorSourceBlend
{
get
{
return this.colorSourceBlend;
}
get { return this.colorSourceBlend; }
set
{
if (this.nativeBlendState.IsBound)
{
throw new InvalidOperationException("You are not allowed to change BlendState properties while it is bound to the GraphicsDevice.");
}
ThrowIfBound();
this.colorSourceBlend = value;
this.nativeBlendState.ColorSourceBlend = value;
@ -222,16 +180,10 @@ namespace ANX.Framework.Graphics
public ColorWriteChannels ColorWriteChannels
{
get
{
return this.colorWriteChannels0;
}
get { return this.colorWriteChannels0; }
set
{
if (this.nativeBlendState.IsBound)
{
throw new InvalidOperationException("You are not allowed to change BlendState properties while it is bound to the GraphicsDevice.");
}
ThrowIfBound();
this.colorWriteChannels0 = value;
this.nativeBlendState.ColorWriteChannels = value;
@ -240,16 +192,10 @@ namespace ANX.Framework.Graphics
public ColorWriteChannels ColorWriteChannels1
{
get
{
return this.colorWriteChannels1;
}
get { return this.colorWriteChannels1; }
set
{
if (this.nativeBlendState.IsBound)
{
throw new InvalidOperationException("You are not allowed to change BlendState properties while it is bound to the GraphicsDevice.");
}
ThrowIfBound();
this.colorWriteChannels1 = value;
this.nativeBlendState.ColorWriteChannels1 = value;
@ -258,16 +204,10 @@ namespace ANX.Framework.Graphics
public ColorWriteChannels ColorWriteChannels2
{
get
{
return this.colorWriteChannels2;
}
get { return this.colorWriteChannels2; }
set
{
if (this.nativeBlendState.IsBound)
{
throw new InvalidOperationException("You are not allowed to change BlendState properties while it is bound to the GraphicsDevice.");
}
ThrowIfBound();
this.colorWriteChannels2 = value;
this.nativeBlendState.ColorWriteChannels2 = value;
@ -276,16 +216,10 @@ namespace ANX.Framework.Graphics
public ColorWriteChannels ColorWriteChannels3
{
get
{
return this.colorWriteChannels3;
}
get { return this.colorWriteChannels3; }
set
{
if (this.nativeBlendState.IsBound)
{
throw new InvalidOperationException("You are not allowed to change BlendState properties while it is bound to the GraphicsDevice.");
}
ThrowIfBound();
this.colorWriteChannels3 = value;
this.nativeBlendState.ColorWriteChannels3 = value;
@ -294,22 +228,23 @@ namespace ANX.Framework.Graphics
public int MultiSampleMask
{
get
{
return this.multiSampleMask;
}
get { return this.multiSampleMask; }
set
{
if (this.nativeBlendState.IsBound)
{
throw new InvalidOperationException("You are not allowed to change BlendState properties while it is bound to the GraphicsDevice.");
}
ThrowIfBound();
this.multiSampleMask = value;
this.nativeBlendState.MultiSampleMask = value;
}
}
private void ThrowIfBound()
{
if (nativeBlendState.IsBound)
throw new InvalidOperationException(
"You are not allowed to change BlendState properties while it is bound to the GraphicsDevice.");
}
public override void Dispose()
{
if (this.nativeBlendState != null)

View File

@ -114,16 +114,10 @@ namespace ANX.Framework.Graphics
public StencilOperation CounterClockwiseStencilDepthBufferFail
{
get
{
return this.counterClockwiseStencilDepthBufferFail;
}
get { return this.counterClockwiseStencilDepthBufferFail; }
set
{
if (this.nativeDepthStencilState.IsBound)
{
throw new InvalidOperationException("You are not allowed to change DepthStencilState properties while it is bound to the GraphicsDevice.");
}
ThrowIfBound();
this.counterClockwiseStencilDepthBufferFail = value;
this.nativeDepthStencilState.CounterClockwiseStencilDepthBufferFail = value;
@ -132,16 +126,10 @@ namespace ANX.Framework.Graphics
public StencilOperation CounterClockwiseStencilFail
{
get
{
return this.counterClockwiseStencilFail;
}
get { return this.counterClockwiseStencilFail; }
set
{
if (this.nativeDepthStencilState.IsBound)
{
throw new InvalidOperationException("You are not allowed to change DepthStencilState properties while it is bound to the GraphicsDevice.");
}
ThrowIfBound();
this.counterClockwiseStencilFail = value;
this.nativeDepthStencilState.CounterClockwiseStencilFail = value;
@ -150,16 +138,10 @@ namespace ANX.Framework.Graphics
public CompareFunction CounterClockwiseStencilFunction
{
get
{
return this.counterClockwiseStencilFunction;
}
get { return this.counterClockwiseStencilFunction; }
set
{
if (this.nativeDepthStencilState.IsBound)
{
throw new InvalidOperationException("You are not allowed to change DepthStencilState properties while it is bound to the GraphicsDevice.");
}
ThrowIfBound();
this.counterClockwiseStencilFunction = value;
this.nativeDepthStencilState.CounterClockwiseStencilFunction = value;
@ -168,16 +150,10 @@ namespace ANX.Framework.Graphics
public StencilOperation CounterClockwiseStencilPass
{
get
{
return this.counterClockwiseStencilPass;
}
get { return this.counterClockwiseStencilPass; }
set
{
if (this.nativeDepthStencilState.IsBound)
{
throw new InvalidOperationException("You are not allowed to change DepthStencilState properties while it is bound to the GraphicsDevice.");
}
ThrowIfBound();
this.counterClockwiseStencilPass = value;
this.nativeDepthStencilState.CounterClockwiseStencilPass = value;
@ -186,16 +162,10 @@ namespace ANX.Framework.Graphics
public bool DepthBufferEnable
{
get
{
return this.depthBufferEnable;
}
get { return this.depthBufferEnable; }
set
{
if (this.nativeDepthStencilState.IsBound)
{
throw new InvalidOperationException("You are not allowed to change DepthStencilState properties while it is bound to the GraphicsDevice.");
}
ThrowIfBound();
this.depthBufferEnable = value;
this.nativeDepthStencilState.DepthBufferEnable = value;
@ -204,16 +174,10 @@ namespace ANX.Framework.Graphics
public CompareFunction DepthBufferFunction
{
get
{
return this.depthBufferFunction;
}
get { return this.depthBufferFunction; }
set
{
if (this.nativeDepthStencilState.IsBound)
{
throw new InvalidOperationException("You are not allowed to change DepthStencilState properties while it is bound to the GraphicsDevice.");
}
ThrowIfBound();
this.depthBufferFunction = value;
this.nativeDepthStencilState.DepthBufferFunction = value;
@ -222,16 +186,10 @@ namespace ANX.Framework.Graphics
public bool DepthBufferWriteEnable
{
get
{
return this.depthBufferWriteEnable;
}
get { return this.depthBufferWriteEnable; }
set
{
if (this.nativeDepthStencilState.IsBound)
{
throw new InvalidOperationException("You are not allowed to change DepthStencilState properties while it is bound to the GraphicsDevice.");
}
ThrowIfBound();
this.depthBufferWriteEnable = value;
this.nativeDepthStencilState.DepthBufferWriteEnable = value;
@ -240,16 +198,10 @@ namespace ANX.Framework.Graphics
public int ReferenceStencil
{
get
{
return this.referenceStencil;
}
get { return this.referenceStencil; }
set
{
if (this.nativeDepthStencilState.IsBound)
{
throw new InvalidOperationException("You are not allowed to change DepthStencilState properties while it is bound to the GraphicsDevice.");
}
ThrowIfBound();
this.referenceStencil = value;
this.nativeDepthStencilState.ReferenceStencil = value;
@ -258,16 +210,10 @@ namespace ANX.Framework.Graphics
public StencilOperation StencilDepthBufferFail
{
get
{
return this.stencilDepthBufferFail;
}
get { return this.stencilDepthBufferFail; }
set
{
if (this.nativeDepthStencilState.IsBound)
{
throw new InvalidOperationException("You are not allowed to change DepthStencilState properties while it is bound to the GraphicsDevice.");
}
ThrowIfBound();
this.stencilDepthBufferFail = value;
this.nativeDepthStencilState.StencilDepthBufferFail = value;
@ -276,16 +222,10 @@ namespace ANX.Framework.Graphics
public bool StencilEnable
{
get
{
return this.stencilEnable;
}
get { return this.stencilEnable; }
set
{
if (this.nativeDepthStencilState.IsBound)
{
throw new InvalidOperationException("You are not allowed to change DepthStencilState properties while it is bound to the GraphicsDevice.");
}
ThrowIfBound();
this.stencilEnable = value;
this.nativeDepthStencilState.StencilEnable = value;
@ -294,16 +234,10 @@ namespace ANX.Framework.Graphics
public StencilOperation StencilFail
{
get
{
return this.stencilFail;
}
get { return this.stencilFail; }
set
{
if (this.nativeDepthStencilState.IsBound)
{
throw new InvalidOperationException("You are not allowed to change DepthStencilState properties while it is bound to the GraphicsDevice.");
}
ThrowIfBound();
this.stencilFail = value;
this.nativeDepthStencilState.StencilFail = value;
@ -312,16 +246,10 @@ namespace ANX.Framework.Graphics
public CompareFunction StencilFunction
{
get
{
return this.stencilFunction;
}
get { return this.stencilFunction; }
set
{
if (this.nativeDepthStencilState.IsBound)
{
throw new InvalidOperationException("You are not allowed to change DepthStencilState properties while it is bound to the GraphicsDevice.");
}
ThrowIfBound();
this.stencilFunction = value;
this.nativeDepthStencilState.StencilFunction = value;
@ -330,16 +258,10 @@ namespace ANX.Framework.Graphics
public int StencilMask
{
get
{
return this.stencilMask;
}
get { return this.stencilMask; }
set
{
if (this.nativeDepthStencilState.IsBound)
{
throw new InvalidOperationException("You are not allowed to change DepthStencilState properties while it is bound to the GraphicsDevice.");
}
ThrowIfBound();
this.stencilMask = value;
this.nativeDepthStencilState.StencilMask = value;
@ -348,16 +270,10 @@ namespace ANX.Framework.Graphics
public StencilOperation StencilPass
{
get
{
return this.stencilPass;
}
get { return this.stencilPass; }
set
{
if (this.nativeDepthStencilState.IsBound)
{
throw new InvalidOperationException("You are not allowed to change DepthStencilState properties while it is bound to the GraphicsDevice.");
}
ThrowIfBound();
this.stencilPass = value;
this.nativeDepthStencilState.StencilPass = value;
@ -366,16 +282,10 @@ namespace ANX.Framework.Graphics
public int StencilWriteMask
{
get
{
return this.stencilWriteMask;
}
get { return this.stencilWriteMask; }
set
{
if (this.nativeDepthStencilState.IsBound)
{
throw new InvalidOperationException("You are not allowed to change DepthStencilState properties while it is bound to the GraphicsDevice.");
}
ThrowIfBound();
this.stencilWriteMask = value;
this.nativeDepthStencilState.StencilWriteMask = value;
@ -384,22 +294,23 @@ namespace ANX.Framework.Graphics
public bool TwoSidedStencilMode
{
get
{
return this.twoSidedStencilMode;
}
get { return this.twoSidedStencilMode; }
set
{
if (this.nativeDepthStencilState.IsBound)
{
throw new InvalidOperationException("You are not allowed to change DepthStencilState properties while it is bound to the GraphicsDevice.");
}
ThrowIfBound();
this.twoSidedStencilMode = value;
this.nativeDepthStencilState.TwoSidedStencilMode = value;
}
}
private void ThrowIfBound()
{
if (nativeDepthStencilState.IsBound)
throw new InvalidOperationException(
"You are not allowed to change DepthStencilState properties while it is bound to the GraphicsDevice.");
}
public override void Dispose()
{
if (this.nativeDepthStencilState != null)

View File

@ -2,6 +2,7 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using ANX.Framework.NonXNA.Development;
#endregion // Using Statements
@ -12,43 +13,33 @@ using ANX.Framework.NonXNA.Development;
namespace ANX.Framework.Graphics
{
[PercentageComplete(30)]
[Developer("Glatzemann")]
[PercentageComplete(100)]
[Developer("AstrorEnales")]
[TestState(TestStateAttribute.TestState.Untested)]
public class DisplayModeCollection : IEnumerable<DisplayMode>, IEnumerable
{
private List<DisplayMode> displayModes = new List<DisplayMode>();
public IEnumerator<DisplayMode> GetEnumerator()
{
throw new NotImplementedException();
}
IEnumerator IEnumerable.GetEnumerator()
{
throw new NotImplementedException();
}
private readonly List<DisplayMode> displayModes;
public IEnumerable<DisplayMode> this[SurfaceFormat format]
{
get
{
foreach (DisplayMode mode in displayModes)
{
if (mode.Format == format)
{
yield return mode;
}
}
}
set
{
foreach (DisplayMode mode in value)
{
displayModes.Add(mode);
}
return displayModes.Where(current => current.Format == format).ToList();
}
}
internal DisplayModeCollection(List<DisplayMode> displayModes)
{
this.displayModes = displayModes;
}
public IEnumerator<DisplayMode> GetEnumerator()
{
return displayModes.GetEnumerator();
}
IEnumerator IEnumerable.GetEnumerator()
{
return GetEnumerator();
}
}
}

View File

@ -25,13 +25,13 @@ namespace ANX.Framework.Graphics
public DynamicIndexBuffer(GraphicsDevice graphicsDevice, IndexElementSize indexElementSize, int indexCount, BufferUsage usage)
: base(graphicsDevice, indexElementSize, indexCount, usage)
{
graphicsDevice.DeviceReset += new EventHandler<EventArgs>(graphicsDevice_DeviceReset);
graphicsDevice.DeviceReset += graphicsDevice_DeviceReset;
}
public DynamicIndexBuffer(GraphicsDevice graphicsDevice, Type indexType, int indexCount, BufferUsage usage)
: base(graphicsDevice, indexType, indexCount, usage)
{
graphicsDevice.DeviceReset += new EventHandler<EventArgs>(graphicsDevice_DeviceReset);
graphicsDevice.DeviceReset += graphicsDevice_DeviceReset;
}
~DynamicIndexBuffer()

View File

@ -25,13 +25,13 @@ namespace ANX.Framework.Graphics
public DynamicVertexBuffer(GraphicsDevice graphicsDevice, Type vertexType, int vertexCount, BufferUsage usage)
: base(graphicsDevice, vertexType, vertexCount, usage)
{
graphicsDevice.DeviceReset += new EventHandler<EventArgs>(graphicsDevice_DeviceReset);
graphicsDevice.DeviceReset += graphicsDevice_DeviceReset;
}
public DynamicVertexBuffer(GraphicsDevice graphicsDevice, VertexDeclaration vertexDeclaration, int vertexCount, BufferUsage usage)
: base(graphicsDevice, vertexDeclaration, vertexCount, usage)
{
graphicsDevice.DeviceReset += new EventHandler<EventArgs>(graphicsDevice_DeviceReset);
graphicsDevice.DeviceReset += graphicsDevice_DeviceReset;
}
~DynamicVertexBuffer()

View File

@ -10,17 +10,14 @@ using ANX.Framework.NonXNA.Development;
namespace ANX.Framework.Graphics
{
[PercentageComplete(90)]
[PercentageComplete(100)]
[Developer("Glatzemann")]
[TestState(TestStateAttribute.TestState.Untested)]
public class Effect : GraphicsResource, IGraphicsResource
{
#region Private
private INativeEffect nativeEffect;
private EffectTechniqueCollection techniqueCollection;
private EffectTechnique currentTechnique;
private EffectParameterCollection parameterCollection;
private byte[] byteCode;
private readonly byte[] byteCode;
private EffectSourceLanguage sourceLanguage;
#endregion
@ -38,34 +35,10 @@ namespace ANX.Framework.Graphics
}
}
public EffectTechnique CurrentTechnique
{
get
{
return this.currentTechnique;
}
set
{
this.currentTechnique = value;
}
}
public EffectParameterCollection Parameters
{
get
{
return this.parameterCollection;
}
}
public EffectTechniqueCollection Techniques
{
get
{
return this.techniqueCollection;
}
}
#endregion
public EffectTechnique CurrentTechnique { get; set; }
public EffectParameterCollection Parameters { get; private set; }
public EffectTechniqueCollection Techniques { get; private set; }
#endregion
#region Constructor
protected Effect(Effect cloneSource)
@ -89,7 +62,7 @@ namespace ANX.Framework.Graphics
CreateNativeEffect(sourceLanguage);
this.currentTechnique = this.techniqueCollection[0];
this.CurrentTechnique = this.Techniques[0];
this.sourceLanguage = sourceLanguage;
}
@ -126,10 +99,10 @@ namespace ANX.Framework.Graphics
}
#endregion
#region Clone (TODO)
#region Clone
public virtual Effect Clone()
{
throw new NotImplementedException();
return new Effect(this);
}
#endregion
@ -142,7 +115,7 @@ namespace ANX.Framework.Graphics
}
#endregion
#region Dispose (TODO)
#region Dispose
public override void Dispose()
{
if (nativeEffect != null)
@ -154,7 +127,14 @@ namespace ANX.Framework.Graphics
protected override void Dispose([MarshalAs(UnmanagedType.U1)] bool disposeManaged)
{
throw new NotImplementedException();
try
{
Dispose();
}
finally
{
base.Dispose(false);
}
}
#endregion
@ -166,8 +146,8 @@ namespace ANX.Framework.Graphics
if (creator.IsLanguageSupported(sourceLanguage))
{
this.nativeEffect = creator.CreateEffect(GraphicsDevice, this, new MemoryStream(this.byteCode, false));
this.techniqueCollection = new EffectTechniqueCollection(this, this.nativeEffect);
this.parameterCollection = new EffectParameterCollection(this, this.nativeEffect);
this.Techniques = new EffectTechniqueCollection(this, this.nativeEffect);
this.Parameters = new EffectParameterCollection(this, this.nativeEffect);
}
else
throw new InvalidOperationException("couldn't create " + sourceLanguage + " native effect using RenderSystem " +

View File

@ -2,6 +2,7 @@
using System;
using System.Collections.Generic;
using System.Collections;
using System.Linq;
using ANX.Framework.NonXNA.Development;
#endregion // Using Statements
@ -12,48 +13,46 @@ using ANX.Framework.NonXNA.Development;
namespace ANX.Framework.Graphics
{
[PercentageComplete(10)]
[Developer("Glatzemann")]
[PercentageComplete(100)]
[Developer("AstrorEnales")]
[TestState(TestStateAttribute.TestState.Untested)]
public sealed class EffectAnnotationCollection : IEnumerable<EffectAnnotation>
{
private readonly List<EffectAnnotation> annotations;
public int Count
{
get { return annotations.Count; }
}
public EffectAnnotation this[int index]
{
get
{
throw new NotImplementedException();
}
get { return index >= 0 && index < annotations.Count ? annotations[index] : null; }
}
public EffectAnnotation this[string name]
{
get
{
throw new NotImplementedException();
}
get { return annotations.FirstOrDefault(annotation => annotation.Name == name); }
}
internal EffectAnnotationCollection()
{
annotations = new List<EffectAnnotation>();
}
IEnumerator<EffectAnnotation> IEnumerable<EffectAnnotation>.GetEnumerator()
{
throw new NotImplementedException();
return annotations.GetEnumerator();
}
IEnumerator IEnumerable.GetEnumerator()
{
throw new NotImplementedException();
return annotations.GetEnumerator();
}
public List<EffectAnnotation>.Enumerator GetEnumerator()
{
throw new NotImplementedException();
}
public int Count
{
get
{
throw new NotImplementedException();
}
return annotations.GetEnumerator();
}
}
}

View File

@ -9,7 +9,7 @@ using ANX.Framework.NonXNA.Development;
namespace ANX.Framework.Graphics
{
[PercentageComplete(60)]
[PercentageComplete(80)]
[TestState(TestStateAttribute.TestState.Untested)]
[Developer("Glatzemann")]
public sealed class EffectParameter
@ -25,69 +25,51 @@ namespace ANX.Framework.Graphics
}
}
public EffectParameterCollection Elements
{
get
{
throw new NotImplementedException();
}
}
public EffectParameterCollection StructureMembers
{
get
{
throw new NotImplementedException();
}
}
public int ColumnCount
{
get
{
throw new NotImplementedException();
}
get { return NativeParameter.ColumnCount; }
}
public EffectParameterCollection Elements
{
get
{
throw new NotImplementedException();
}
}
public string Name
{
get { return NativeParameter.Name; }
}
public string Name
{
get
{
return this.NativeParameter.Name;
}
}
public EffectParameterClass ParameterClass
{
get { return NativeParameter.ParameterClass; }
}
public EffectParameterClass ParameterClass
{
get
{
throw new NotImplementedException();
}
}
public EffectParameterType ParameterType
{
get { return NativeParameter.ParameterType; }
}
public EffectParameterType ParameterType
{
get
{
throw new NotImplementedException();
}
}
public int RowCount
{
get { return NativeParameter.RowCount; }
}
public int RowCount
{
get
{
throw new NotImplementedException();
}
}
public string Semantic
{
get
{
return this.NativeParameter.Semantic;
}
}
public EffectParameterCollection StructureMembers
{
get
{
throw new NotImplementedException();
}
}
public string Semantic
{
get { return NativeParameter.Semantic; }
}
#endregion
#region GetValue

View File

@ -7,7 +7,7 @@ namespace ANX.Framework.Graphics
{
[PercentageComplete(100)]
[Developer("Glatzemann")]
[TestState(TestStateAttribute.TestState.Untested)]
[TestState(TestStateAttribute.TestState.Tested)]
public enum EffectParameterClass
{
Scalar,

View File

@ -1,6 +1,7 @@
#region Using Statements
using System;
using System.Collections.Generic;
using System.Linq;
using ANX.Framework.NonXNA;
using System.Collections;
using ANX.Framework.NonXNA.Development;
@ -24,6 +25,21 @@ namespace ANX.Framework.Graphics
private List<EffectParameter> parameters;
#endregion
public EffectParameter this[int index]
{
get { return index >= 0 && index < parameters.Count ? parameters[index] : null; }
}
public EffectParameter this[string name]
{
get { return parameters.FirstOrDefault(t => t.Name == name); }
}
public int Count
{
get { return parameters.Count; }
}
internal EffectParameterCollection(Effect parentEffect, INativeEffect nativeEffect)
{
this.parentEffect = parentEffect;
@ -36,35 +52,6 @@ namespace ANX.Framework.Graphics
}
}
public EffectParameter this[int index]
{
get
{
if (index >= parameters.Count)
{
throw new ArgumentOutOfRangeException("index");
}
return parameters[index];
}
}
public EffectParameter this[string name]
{
get
{
for (int i = 0; i < parameters.Count; i++)
{
if (parameters[i].Name == name)
{
return parameters[i];
}
}
return null;
}
}
public EffectParameter GetParameterBySemantic(string semantic)
{
foreach (EffectParameter parameter in parameters)
@ -92,13 +79,5 @@ namespace ANX.Framework.Graphics
{
return parameters.GetEnumerator();
}
public int Count
{
get
{
return this.parameters.Count;
}
}
}
}

View File

@ -2,6 +2,7 @@
using System;
using System.Collections.Generic;
using System.Collections;
using System.Linq;
using ANX.Framework.NonXNA;
using ANX.Framework.NonXNA.Development;
@ -14,7 +15,7 @@ using ANX.Framework.NonXNA.Development;
namespace ANX.Framework.Graphics
{
[PercentageComplete(100)]
[Developer("Glatzemann")]
[Developer("Glatzemann, AstrorEnales")]
[TestState(TestStateAttribute.TestState.Untested)]
public sealed class EffectPassCollection : IEnumerable<EffectPass>
{
@ -22,10 +23,25 @@ namespace ANX.Framework.Graphics
private Effect parentEffect;
private INativeEffect nativeEffect;
private INativeEffectTechnique parentTechnique;
private List<EffectPass> passes;
private readonly List<EffectPass> passes;
#endregion // Private Members
public EffectPass this[int index]
{
get { return index >= 0 && index < passes.Count ? passes[index] : null; }
}
public EffectPass this[string name]
{
get { return passes.FirstOrDefault(pass => pass.Name == name); }
}
public int Count
{
get { return passes.Count; }
}
internal EffectPassCollection(Effect parentEffect, INativeEffect nativeEffect, INativeEffectTechnique parentTechnique)
{
this.parentEffect = parentEffect;
@ -39,48 +55,19 @@ namespace ANX.Framework.Graphics
}
}
public EffectPass this[int index]
{
get
{
if (index >= passes.Count)
{
throw new ArgumentOutOfRangeException("index");
}
return passes[index];
}
}
public EffectPass this[string name]
{
get
{
throw new NotImplementedException();
}
}
IEnumerator<EffectPass> IEnumerable<EffectPass>.GetEnumerator()
{
return (IEnumerator<EffectPass>)this.passes.GetEnumerator();
return passes.GetEnumerator();
}
IEnumerator IEnumerable.GetEnumerator()
{
return (IEnumerator)this.passes.GetEnumerator();
return passes.GetEnumerator();
}
public List<EffectPass>.Enumerator GetEnumerator()
{
return this.passes.GetEnumerator();
return passes.GetEnumerator();
}
public int Count
{
get
{
return this.passes.Count;
}
}
}
}

View File

@ -16,7 +16,7 @@ using ANX.Framework.NonXNA.Development;
namespace ANX.Framework.Graphics
{
[PercentageComplete(100)]
[Developer("Glatzemann")]
[Developer("Glatzemann, AstrorEnales")]
[TestState(TestStateAttribute.TestState.Untested)]
public sealed class EffectTechniqueCollection : IEnumerable<EffectTechnique>, IEnumerable
{
@ -27,6 +27,21 @@ namespace ANX.Framework.Graphics
#endregion // Private Members
public EffectTechnique this[int index]
{
get { return index >= 0 && index < techniques.Count ? techniques[index] : null; }
}
public EffectTechnique this[string name]
{
get { return techniques.FirstOrDefault(t => t.Name == name); }
}
public int Count
{
get { return techniques.Count; }
}
internal EffectTechniqueCollection(Effect parentEffect, INativeEffect nativeEffect)
{
this.parentEffect = parentEffect;
@ -39,58 +54,19 @@ namespace ANX.Framework.Graphics
}
}
public EffectTechnique this[int index]
{
get
{
if (index >= techniques.Count)
{
throw new ArgumentOutOfRangeException("index");
}
return techniques[index];
}
}
public EffectTechnique this[string name]
{
get
{
foreach (EffectTechnique teq in techniques)
{
if (teq.Name.Equals(name))
{
return teq;
}
}
throw new ArgumentException("No technique with name '" + name + "' found.");
}
}
IEnumerator<EffectTechnique> IEnumerable<EffectTechnique>.GetEnumerator()
{
throw new NotImplementedException();
{
return techniques.GetEnumerator();
}
IEnumerator IEnumerable.GetEnumerator()
{
throw new NotImplementedException();
{
return techniques.GetEnumerator();
}
public List<EffectTechnique>.Enumerator GetEnumerator()
{
throw new NotImplementedException();
}
public int Count
{
get
{
return this.techniques.Count;
}
}
return techniques.GetEnumerator();
}
}
}

View File

@ -1,8 +1,9 @@
#region Using Statements
using System;
using System.Collections.ObjectModel;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using ANX.Framework.NonXNA.Development;
#endregion // Using Statements
@ -12,9 +13,12 @@ using System.Collections.Generic;
namespace ANX.Framework.Graphics
{
[PercentageComplete(100)]
[Developer("???, AstrorEnales")]
[TestState(TestStateAttribute.TestState.Untested)]
public sealed class ModelBoneCollection : ReadOnlyCollection<ModelBone>
{
private ModelBone[] modelBones;
private readonly ModelBone[] modelBones;
internal ModelBoneCollection(ModelBone[] modelBones)
: base(modelBones)
@ -29,23 +33,25 @@ namespace ANX.Framework.Graphics
public struct Enumerator : IEnumerator<ModelBone>, IDisposable, IEnumerator
{
private ModelBone[] wrappedArray;
private readonly ModelBone[] wrappedArray;
private int position;
public ModelBone Current
{
get { return this.wrappedArray[this.position]; }
}
object IEnumerator.Current
{
get { return this.Current; }
}
internal Enumerator(ModelBone[] wrappedArray)
{
this.wrappedArray = wrappedArray;
this.position = -1;
}
public ModelBone Current
{
get
{
return this.wrappedArray[this.position];
}
}
public bool MoveNext()
{
this.position++;
@ -65,26 +71,36 @@ namespace ANX.Framework.Graphics
public void Dispose()
{
}
object IEnumerator.Current
{
get
{
return this.Current;
}
}
}
public bool TryGetValue (string boneName, out ModelBone value)
public bool TryGetValue(string boneName, out ModelBone value)
{
throw new NotImplementedException();
if (String.IsNullOrEmpty(boneName))
throw new ArgumentNullException("boneName");
for (int index = 0; index < Items.Count; index++)
{
ModelBone modelBone = Items[index];
if (String.Compare(modelBone.Name, boneName, StringComparison.Ordinal) == 0)
{
value = modelBone;
return true;
}
}
value = null;
return false;
}
public ModelBone this[string boneName]
{
get
{
throw new NotImplementedException();
ModelBone result;
if (TryGetValue(boneName, out result) == false)
throw new KeyNotFoundException();
return result;
}
}

View File

@ -3,6 +3,7 @@ using System;
using System.Collections.ObjectModel;
using System.Collections.Generic;
using System.Collections;
using ANX.Framework.NonXNA.Development;
#endregion // Using Statements
@ -12,9 +13,12 @@ using System.Collections;
namespace ANX.Framework.Graphics
{
[PercentageComplete(100)]
[Developer("???")]
[TestState(TestStateAttribute.TestState.Untested)]
public sealed class ModelEffectCollection : ReadOnlyCollection<Effect>
{
private List<Effect> effects;
private readonly List<Effect> effects;
internal ModelEffectCollection()
: base(new List<Effect>())
@ -39,7 +43,7 @@ namespace ANX.Framework.Graphics
public struct Enumerator : IEnumerator<Effect>, IDisposable, IEnumerator
{
private List<Effect> wrappedArray;
private readonly List<Effect> wrappedArray;
private int position;
internal Enumerator(List<Effect> wrappedArray)

View File

@ -3,6 +3,7 @@ using System;
using System.Collections.ObjectModel;
using System.Collections.Generic;
using System.Collections;
using ANX.Framework.NonXNA.Development;
#endregion // Using Statements
@ -12,9 +13,12 @@ using System.Collections;
namespace ANX.Framework.Graphics
{
[PercentageComplete(100)]
[Developer("???, AstrorEnales")]
[TestState(TestStateAttribute.TestState.Untested)]
public sealed class ModelMeshCollection : ReadOnlyCollection<ModelMesh>
{
private ModelMesh[] modelMeshes;
private readonly ModelMesh[] modelMeshes;
internal ModelMeshCollection(ModelMesh[] modelMeshes)
: base(modelMeshes)
@ -29,7 +33,7 @@ namespace ANX.Framework.Graphics
public struct Enumerator : IEnumerator<ModelMesh>, IDisposable, IEnumerator
{
private ModelMesh[] wrappedArray;
private readonly ModelMesh[] wrappedArray;
private int position;
internal Enumerator(ModelMesh[] wrappedArray)
@ -77,16 +81,34 @@ namespace ANX.Framework.Graphics
public bool TryGetValue(string meshName, out ModelMesh value)
{
throw new NotImplementedException();
if (String.IsNullOrEmpty(meshName))
throw new ArgumentNullException("meshName");
for (int index = 0; index < Items.Count; index++)
{
ModelMesh modelMesh = Items[index];
if (String.Compare(modelMesh.Name, meshName, StringComparison.Ordinal) == 0)
{
value = modelMesh;
return true;
}
}
value = null;
return false;
}
public ModelMesh this[string meshName]
{
get
{
throw new NotImplementedException();
ModelMesh result;
if (TryGetValue(meshName, out result) == false)
{
throw new KeyNotFoundException();
}
return result;
}
}
}
}

View File

@ -14,7 +14,7 @@ namespace ANX.Framework.Graphics
[TestState(TestStateAttribute.TestState.Untested)]
public sealed class ModelMeshPartCollection : ReadOnlyCollection<ModelMeshPart>
{
private ModelMeshPart[] modelMeshParts;
private readonly ModelMeshPart[] modelMeshParts;
internal ModelMeshPartCollection(ModelMeshPart[] modelMeshParts)
: base(modelMeshParts)
@ -29,7 +29,7 @@ namespace ANX.Framework.Graphics
public struct Enumerator : IEnumerator<ModelMeshPart>, IDisposable, IEnumerator
{
private ModelMeshPart[] wrappedArray;
private readonly ModelMeshPart[] wrappedArray;
private int position;
public ModelMeshPart Current

View File

@ -1,3 +1,4 @@
using System;
using ANX.Framework.NonXNA.Development;
// This file is part of the ANX.Framework created by the
@ -6,11 +7,12 @@ using ANX.Framework.NonXNA.Development;
namespace ANX.Framework.Graphics
{
[PercentageComplete(100)]
[PercentageComplete(100)]
[TestState(TestStateAttribute.TestState.Untested)]
public sealed class SamplerStateCollection
{
private SamplerState[] samplerStates;
private GraphicsDevice graphics;
private readonly SamplerState[] samplerStates;
private readonly GraphicsDevice graphics;
public SamplerStateCollection(GraphicsDevice graphics, int maxSamplers)
{
@ -25,6 +27,9 @@ namespace ANX.Framework.Graphics
{
get
{
if (index < 0 || index >= samplerStates.Length)
throw new ArgumentOutOfRangeException("index");
return samplerStates[index];
}
set

View File

@ -17,8 +17,11 @@ namespace ANX.Framework.NonXNA
public interface INativeEffectParameter
{
string Name { get; }
string Semantic { get; }
int ColumnCount { get; }
int RowCount { get; }
EffectParameterClass ParameterClass { get; }
EffectParameterType ParameterType { get; }
#region GetValue
bool GetValueBoolean();

View File

@ -255,12 +255,11 @@ namespace ANX.RenderSystem.GL3
var result = new List<GraphicsAdapter>();
foreach (DisplayDevice device in DisplayDevice.AvailableDisplays)
{
var displayModeCollection = new DisplayModeCollection();
{
var resultingModes = new List<DisplayMode>();
foreach (string format in Enum.GetNames(typeof(SurfaceFormat)))
{
SurfaceFormat surfaceFormat =
(SurfaceFormat)Enum.Parse(typeof(SurfaceFormat), format);
SurfaceFormat surfaceFormat = (SurfaceFormat)Enum.Parse(typeof(SurfaceFormat), format);
// TODO: device.BitsPerPixel
if (surfaceFormat != SurfaceFormat.Color)//adapter.Supports(surfaceFormat) == false)
@ -268,12 +267,10 @@ namespace ANX.RenderSystem.GL3
continue;
}
var modes = new List<DisplayMode>();
foreach (DisplayResolution res in device.AvailableResolutions)
{
float aspect = (float)res.Width / (float)res.Height;
modes.Add(new DisplayMode
resultingModes.Add(new DisplayMode
{
AspectRatio = aspect,
Width = res.Width,
@ -282,13 +279,11 @@ namespace ANX.RenderSystem.GL3
Format = surfaceFormat,
});
}
displayModeCollection[surfaceFormat] = modes.ToArray();
}
GraphicsAdapter newAdapter = new GraphicsAdapter
var newAdapter = new GraphicsAdapter
{
SupportedDisplayModes = displayModeCollection,
SupportedDisplayModes = new DisplayModeCollection(resultingModes),
IsDefaultAdapter = device.IsPrimary,
// TODO:

View File

@ -20,31 +20,40 @@ namespace ANX.RenderSystem.GL3
#endregion
#region Public
/// <summary>
/// The name of the effect parameter.
/// </summary>
public string Name
{
get;
private set;
}
/// <summary>
/// The name of the effect parameter.
/// </summary>
public string Name { get; private set; }
/// <summary>
/// The index of the uniform.
/// </summary>
public int UniformIndex { get; private set; }
public string Semantic
{
get
{
throw new NotSupportedException();
}
get { throw new NotSupportedException(); }
}
/// <summary>
/// The index of the uniform.
/// </summary>
public int UniformIndex
{
get;
private set;
}
public int ColumnCount
{
get { throw new NotImplementedException(); }
}
public int RowCount
{
get { throw new NotImplementedException(); }
}
public EffectParameterClass ParameterClass
{
get { throw new NotImplementedException(); }
}
public EffectParameterType ParameterType
{
get { throw new NotImplementedException(); }
}
#endregion
#region Constructor

View File

@ -1,6 +1,7 @@
#region Using Statements
using System;
using ANX.Framework.Graphics;
using SharpDX.D3DCompiler;
using SharpDX.Direct3D;
using SharpDX.DXGI;
@ -174,29 +175,32 @@ namespace ANX.RenderSystem.Windows.DX11
#region Translate (VertexElement)
public static string Translate(ref VertexElement element)
{
//TODO: map the other Usages
//TODO: map the other Usages
if (element.VertexElementUsage == VertexElementUsage.TextureCoordinate)
return "TEXCOORD";
else
return element.VertexElementUsage.ToString().ToUpperInvariant();
return element.VertexElementUsage.ToString().ToUpperInvariant();
}
#endregion
#endregion
#region CalculateVertexCount
public static int CalculateVertexCount(PrimitiveType type, int primitiveCount)
{
if (type == PrimitiveType.TriangleList)
return primitiveCount * 3;
else if (type == PrimitiveType.LineList)
return primitiveCount * 2;
else if (type == PrimitiveType.LineStrip)
return primitiveCount + 1;
else if (type == PrimitiveType.TriangleStrip)
return primitiveCount + 2;
switch (type)
{
case PrimitiveType.TriangleList:
return primitiveCount * 3;
case PrimitiveType.LineList:
return primitiveCount * 2;
case PrimitiveType.LineStrip:
return primitiveCount + 1;
case PrimitiveType.TriangleStrip:
return primitiveCount + 2;
}
throw new NotImplementedException("Couldn't calculate vertex count for PrimitiveType '" + type + "'.");
throw new NotImplementedException("Couldn't calculate vertex count for PrimitiveType '" + type + "'.");
}
#endregion
#endregion
#region ConvertVertexElementFormat
public static Format ConvertVertexElementFormat(VertexElementFormat format)
@ -222,6 +226,57 @@ namespace ANX.RenderSystem.Windows.DX11
throw new Exception("Can't map '" + format + "' to DXGI.Format in Dx10 CreateInputElementFromVertexElement.");
}
#endregion
#endregion
#region Translate (ShaderVariableType)
public static EffectParameterType Translate(ShaderVariableType type)
{
switch (type)
{
case ShaderVariableType.Bool:
return EffectParameterType.Bool;
case ShaderVariableType.Texture1D:
return EffectParameterType.Texture1D;
case ShaderVariableType.Texture2D:
return EffectParameterType.Texture2D;
case ShaderVariableType.Texture3D:
return EffectParameterType.Texture3D;
case ShaderVariableType.Texture:
return EffectParameterType.Texture;
case ShaderVariableType.Void:
return EffectParameterType.Void;
case ShaderVariableType.Int:
return EffectParameterType.Int32;
case ShaderVariableType.Float:
return EffectParameterType.Single;
case ShaderVariableType.String:
return EffectParameterType.String;
case ShaderVariableType.TextureCube:
return EffectParameterType.TextureCube;
}
return EffectParameterType.Void;
}
#endregion
#region Translate (ShaderVariableType)
public static EffectParameterClass Translate(ShaderVariableClass type)
{
switch (type)
{
case ShaderVariableClass.Scalar:
return EffectParameterClass.Scalar;
case ShaderVariableClass.Vector:
return EffectParameterClass.Vector;
case ShaderVariableClass.Struct:
return EffectParameterClass.Struct;
case ShaderVariableClass.MatrixRows:
case ShaderVariableClass.MatrixColumns:
return EffectParameterClass.Matrix;
}
return EffectParameterClass.Object;
}
#endregion
}
}

View File

@ -172,10 +172,10 @@ namespace ANX.RenderSystem.Windows.DX10
{
PreventSystemChange();
SharpDX.DXGI.Factory factory = new Factory();
var factory = new Factory();
List<GraphicsAdapter> adapterList = new List<GraphicsAdapter>();
DisplayModeCollection displayModeCollection = new DisplayModeCollection();
var adapterList = new List<GraphicsAdapter>();
var resultingModes = new List<DisplayMode>();
for (int i = 0; i < factory.GetAdapterCount(); i++)
{
@ -196,7 +196,8 @@ namespace ANX.RenderSystem.Windows.DX10
using (Output adapterOutput = adapter.Outputs[0])
{
var modeList = adapterOutput.GetDisplayModeList(Format.R8G8B8A8_UNorm, DisplayModeEnumerationFlags.Interlaced);
var modeList = adapterOutput.GetDisplayModeList(Format.R8G8B8A8_UNorm,
DisplayModeEnumerationFlags.Interlaced);
foreach (ModeDescription modeDescription in modeList)
{
DisplayMode displayMode = new DisplayMode()
@ -208,11 +209,11 @@ namespace ANX.RenderSystem.Windows.DX10
TitleSafeArea = new Rectangle(0, 0, modeDescription.Width, modeDescription.Height), //TODO: calculate this for real
};
displayModeCollection[displayMode.Format] = new DisplayMode[] { displayMode };
resultingModes.Add(displayMode);
}
}
ga.SupportedDisplayModes = displayModeCollection;
ga.SupportedDisplayModes = new DisplayModeCollection(resultingModes);
adapterList.Add(ga);
}

View File

@ -11,34 +11,44 @@ using ANX.Framework.NonXNA.Development;
namespace ANX.RenderSystem.Windows.DX10
{
[PercentageComplete(70)]
[PercentageComplete(50)]
[TestState(TestStateAttribute.TestState.Untested)]
[Developer("Glatzemann")]
public class EffectParameter_DX10 : INativeEffectParameter
{
#region Public
public Dx10.EffectVariable NativeParameter
{
get;
internal set;
}
public Dx10.EffectVariable NativeParameter { get; internal set; }
public string Name
{
get
{
return NativeParameter.Description.Name;
}
}
public string Name
{
get { return NativeParameter.Description.Name; }
}
public string Semantic
{
get
{
return NativeParameter.Description.Semantic;
}
get { return NativeParameter.Description.Semantic; }
}
#endregion
public int ColumnCount
{
get { return NativeParameter.TypeInfo.Description.Columns; }
}
public int RowCount
{
get { return NativeParameter.TypeInfo.Description.Rows; }
}
public EffectParameterClass ParameterClass
{
get { return DxFormatConverter.Translate(NativeParameter.TypeInfo.Description.Class); }
}
public EffectParameterType ParameterType
{
get { return DxFormatConverter.Translate(NativeParameter.TypeInfo.Description.Type); }
}
#endregion
#region SetValue (bool)
public void SetValue(bool value)

View File

@ -8,6 +8,7 @@ using ANX.Framework.NonXNA;
using ANX.Framework.NonXNA.RenderSystem;
using SharpDX.DXGI;
using ANX.Framework.NonXNA.Development;
using System.Collections.ObjectModel;
#endregion
@ -160,14 +161,14 @@ namespace ANX.RenderSystem.Windows.DX11
#endregion
#region GetAdapterList
public System.Collections.ObjectModel.ReadOnlyCollection<GraphicsAdapter> GetAdapterList()
public ReadOnlyCollection<GraphicsAdapter> GetAdapterList()
{
PreventSystemChange();
var factory = new Factory();
List<GraphicsAdapter> adapterList = new List<GraphicsAdapter>();
DisplayModeCollection displayModeCollection = new DisplayModeCollection();
var adapterList = new List<GraphicsAdapter>();
var resultingModes = new List<DisplayMode>();
for (int i = 0; i < factory.GetAdapterCount(); i++)
{
@ -190,7 +191,7 @@ namespace ANX.RenderSystem.Windows.DX11
{
foreach (ModeDescription modeDescription in adapterOutput.GetDisplayModeList(Format.R8G8B8A8_UNorm, DisplayModeEnumerationFlags.Interlaced))
{
DisplayMode displayMode = new DisplayMode()
var displayMode = new DisplayMode
{
Format = DxFormatConverter.Translate(modeDescription.Format),
Width = modeDescription.Width,
@ -199,13 +200,13 @@ namespace ANX.RenderSystem.Windows.DX11
TitleSafeArea = new Rectangle(0, 0, modeDescription.Width, modeDescription.Height), //TODO: calculate this for real
};
displayModeCollection[displayMode.Format] = new DisplayMode[] { displayMode };
resultingModes.Add(displayMode);
}
break; //TODO: for the moment only adapter output 0 is interesting...
}
ga.SupportedDisplayModes = displayModeCollection;
ga.SupportedDisplayModes = new DisplayModeCollection(resultingModes);
adapterList.Add(ga);
}

View File

@ -11,34 +11,44 @@ using ANX.Framework.NonXNA.Development;
namespace ANX.RenderSystem.Windows.DX11
{
[PercentageComplete(60)]
[PercentageComplete(50)]
[TestState(TestStateAttribute.TestState.Untested)]
[Developer("Glatzemann")]
public class EffectParameter_DX11 : INativeEffectParameter
{
#region Public
public Dx11.EffectVariable NativeParameter
{
get;
internal set;
}
public Dx11.EffectVariable NativeParameter { get; internal set; }
public string Name
{
get
{
return NativeParameter.Description.Name;
}
}
public string Name
{
get { return NativeParameter.Description.Name; }
}
public string Semantic
{
get
{
return NativeParameter.Description.Semantic;
}
get { return NativeParameter.Description.Semantic; }
}
#endregion
public int ColumnCount
{
get { return NativeParameter.TypeInfo.Description.Columns; }
}
public int RowCount
{
get { return NativeParameter.TypeInfo.Description.Rows; }
}
public EffectParameterClass ParameterClass
{
get { return DxFormatConverter.Translate(NativeParameter.TypeInfo.Description.Class); }
}
public EffectParameterType ParameterType
{
get { return DxFormatConverter.Translate(NativeParameter.TypeInfo.Description.Type); }
}
#endregion
#region SetValue (bool)
public void SetValue(bool value)
@ -283,5 +293,5 @@ namespace ANX.RenderSystem.Windows.DX11
throw new NotImplementedException();
}
#endregion
}
}
}

View File

@ -33,6 +33,26 @@ namespace ANX.RenderSystem.Windows.Metro
throw new NotSupportedException();
}
}
public int ColumnCount
{
get { throw new NotImplementedException(); }
}
public int RowCount
{
get { throw new NotImplementedException(); }
}
public EffectParameterClass ParameterClass
{
get { throw new NotImplementedException(); }
}
public EffectParameterType ParameterType
{
get { throw new NotImplementedException(); }
}
#endregion
#region Constructor

View File

@ -86,15 +86,15 @@
</Tags>
</Sample>
<Sample>
<Name>BasicEffectSample</Name>
<Description>A Sample demonstrating all possible uses of the BasicEffect class.</Description>
<ExecPath>BasicEffectSample\bin\x86\Debug\BasicEffectSample.exe</ExecPath>
<Categorie>Rendering</Categorie>
<Tags>
<Tag>3D</Tag>
</Tags>
</Sample>
<Sample>
<Name>BasicEffectSample</Name>
<Description>A Sample demonstrating all possible uses of the BasicEffect class.</Description>
<ExecPath>BasicEffectSample\bin\x86\Debug\BasicEffectSample.exe</ExecPath>
<Categorie>Rendering</Categorie>
<Tags>
<Tag>3D</Tag>
</Tags>
</Sample>
<Sample>
<Name>SpriteSample</Name>