diff --git a/ANX.Framework/ANX.Framework.csproj b/ANX.Framework/ANX.Framework.csproj index 74a11c0b..b49d8d2f 100644 --- a/ANX.Framework/ANX.Framework.csproj +++ b/ANX.Framework/ANX.Framework.csproj @@ -445,6 +445,7 @@ + diff --git a/ANX.Framework/ANX.Framework_Linux.csproj b/ANX.Framework/ANX.Framework_Linux.csproj index c107ea52..73aae983 100644 --- a/ANX.Framework/ANX.Framework_Linux.csproj +++ b/ANX.Framework/ANX.Framework_Linux.csproj @@ -445,6 +445,7 @@ + diff --git a/ANX.Framework/ANX.Framework_PSVita.csproj b/ANX.Framework/ANX.Framework_PSVita.csproj index e03ef844..e18b9404 100644 --- a/ANX.Framework/ANX.Framework_PSVita.csproj +++ b/ANX.Framework/ANX.Framework_PSVita.csproj @@ -447,6 +447,7 @@ + diff --git a/ANX.Framework/ANX.Framework_WindowsMetro.csproj b/ANX.Framework/ANX.Framework_WindowsMetro.csproj index 9aaf8807..0d02d896 100644 --- a/ANX.Framework/ANX.Framework_WindowsMetro.csproj +++ b/ANX.Framework/ANX.Framework_WindowsMetro.csproj @@ -448,6 +448,7 @@ + diff --git a/ANX.Framework/Graphics/EffectAnnotation.cs b/ANX.Framework/Graphics/EffectAnnotation.cs index d52783e0..4a03f3be 100644 --- a/ANX.Framework/Graphics/EffectAnnotation.cs +++ b/ANX.Framework/Graphics/EffectAnnotation.cs @@ -1,5 +1,6 @@ using System; using ANX.Framework.NonXNA.Development; +using ANX.Framework.NonXNA.RenderSystem; // This file is part of the ANX.Framework created by the // "ANX.Framework developer group" and released under the Ms-PL license. @@ -7,97 +8,86 @@ using ANX.Framework.NonXNA.Development; namespace ANX.Framework.Graphics { - [PercentageComplete(10)] - [Developer("Glatzemann")] + [PercentageComplete(100)] + [Developer("AstrorEnales")] [TestState(TestStateAttribute.TestState.Untested)] public sealed class EffectAnnotation - { + { + private readonly INativeEffectAnnotation nativeAnnotation; + public int ColumnCount { - get - { - throw new NotImplementedException(); - } + get { return nativeAnnotation.ColumnCount; } } public string Name { - get - { - throw new NotImplementedException(); - } + get { return nativeAnnotation.Name; } } public EffectParameterClass ParameterClass { - get - { - throw new NotImplementedException(); - } + get { return nativeAnnotation.ParameterClass; } } public EffectParameterType ParameterType { - get - { - throw new NotImplementedException(); - } + get { return nativeAnnotation.ParameterType; } } public int RowCount { - get - { - throw new NotImplementedException(); - } + get { return nativeAnnotation.RowCount; } } public string Semantic { - get - { - throw new NotImplementedException(); - } + get { return nativeAnnotation.Semantic; } } + internal EffectAnnotation(INativeEffectAnnotation setNativeAnnotation) + { + nativeAnnotation = setNativeAnnotation; + } + public bool GetValueBoolean() { - throw new NotImplementedException(); + return nativeAnnotation.GetValueBoolean(); } public int GetValueInt32() { - throw new NotImplementedException(); + return nativeAnnotation.GetValueInt32(); } public Matrix GetValueMatrix() { - throw new NotImplementedException(); + return nativeAnnotation.GetValueMatrix(); } public float GetValueSingle() { - throw new NotImplementedException(); + return nativeAnnotation.GetValueSingle(); } public string GetValueString() { - throw new NotImplementedException(); + return nativeAnnotation.GetValueString(); } public Vector2 GetValueVector2() { - throw new NotImplementedException(); + return nativeAnnotation.GetValueVector2(); } public Vector3 GetValueVector3() { - throw new NotImplementedException(); + return nativeAnnotation.GetValueVector3(); } public Vector4 GetValueVector4() { - throw new NotImplementedException(); + return nativeAnnotation.GetValueVector4(); } } } diff --git a/ANX.Framework/Graphics/EffectAnnotationCollection.cs b/ANX.Framework/Graphics/EffectAnnotationCollection.cs index 3b93ae92..4aecd0b0 100644 --- a/ANX.Framework/Graphics/EffectAnnotationCollection.cs +++ b/ANX.Framework/Graphics/EffectAnnotationCollection.cs @@ -35,9 +35,9 @@ namespace ANX.Framework.Graphics get { return annotations.FirstOrDefault(annotation => annotation.Name == name); } } - internal EffectAnnotationCollection() + internal EffectAnnotationCollection(List setAnnotations) { - annotations = new List(); + annotations = setAnnotations ?? new List(); } IEnumerator IEnumerable.GetEnumerator() diff --git a/ANX.Framework/Graphics/EffectParameter.cs b/ANX.Framework/Graphics/EffectParameter.cs index 0f694740..62e536ec 100644 --- a/ANX.Framework/Graphics/EffectParameter.cs +++ b/ANX.Framework/Graphics/EffectParameter.cs @@ -9,280 +9,276 @@ using ANX.Framework.NonXNA.Development; namespace ANX.Framework.Graphics { - [PercentageComplete(80)] + [PercentageComplete(100)] [TestState(TestStateAttribute.TestState.Untested)] [Developer("Glatzemann")] public sealed class EffectParameter { - #region Public (TODO) - public INativeEffectParameter NativeParameter { get; set; } + private readonly INativeEffectParameter nativeParameter; - public EffectAnnotationCollection Annotations - { - get - { - throw new NotImplementedException(); - } - } + #region Public + public EffectAnnotationCollection Annotations + { + get { return nativeParameter.Annotations; } + } public EffectParameterCollection Elements { - get - { - throw new NotImplementedException(); - } + get { return nativeParameter.Elements; } } public EffectParameterCollection StructureMembers { - get - { - throw new NotImplementedException(); - } + get { return nativeParameter.StructureMembers; } } public int ColumnCount { - get { return NativeParameter.ColumnCount; } + get { return nativeParameter.ColumnCount; } } public string Name { - get { return NativeParameter.Name; } + get { return nativeParameter.Name; } } public EffectParameterClass ParameterClass { - get { return NativeParameter.ParameterClass; } + get { return nativeParameter.ParameterClass; } } public EffectParameterType ParameterType { - get { return NativeParameter.ParameterType; } + get { return nativeParameter.ParameterType; } } public int RowCount { - get { return NativeParameter.RowCount; } + get { return nativeParameter.RowCount; } } public string Semantic { - get { return NativeParameter.Semantic; } + get { return nativeParameter.Semantic; } } #endregion + internal EffectParameter(INativeEffectParameter nativeParameter) + { + this.nativeParameter = nativeParameter; + } + #region GetValue public bool GetValueBoolean() { - return NativeParameter.GetValueBoolean(); + return nativeParameter.GetValueBoolean(); } public bool[] GetValueBooleanArray(int count) { - return NativeParameter.GetValueBooleanArray(count); + return nativeParameter.GetValueBooleanArray(count); } public int GetValueInt32() { - return NativeParameter.GetValueInt32(); + return nativeParameter.GetValueInt32(); } public Int32[] GetValueInt32Array(int count) { - return NativeParameter.GetValueInt32Array(count); + return nativeParameter.GetValueInt32Array(count); } public Matrix GetValueMatrix() { - return NativeParameter.GetValueMatrix(); + return nativeParameter.GetValueMatrix(); } public Matrix[] GetValueMatrixArray(int count) { - return NativeParameter.GetValueMatrixArray(count); + return nativeParameter.GetValueMatrixArray(count); } public Matrix GetValueMatrixTranspose() { - return NativeParameter.GetValueMatrixTranspose(); + return nativeParameter.GetValueMatrixTranspose(); } public Matrix[] GetValueMatrixTransposeArray(int count) { - return NativeParameter.GetValueMatrixTransposeArray(count); + return nativeParameter.GetValueMatrixTransposeArray(count); } public Quaternion GetValueQuaternion() { - return NativeParameter.GetValueQuaternion(); + return nativeParameter.GetValueQuaternion(); } public Quaternion[] GetValueQuaternionArray(int count) { - return NativeParameter.GetValueQuaternionArray(count); + return nativeParameter.GetValueQuaternionArray(count); } public float GetValueSingle() { - return NativeParameter.GetValueSingle(); + return nativeParameter.GetValueSingle(); } public float[] GetValueSingleArray(int count) { - return NativeParameter.GetValueSingleArray(count); + return nativeParameter.GetValueSingleArray(count); } public string GetValueString() { - return NativeParameter.GetValueString(); + return nativeParameter.GetValueString(); } public Texture2D GetValueTexture2D() { - return NativeParameter.GetValueTexture2D(); + return nativeParameter.GetValueTexture2D(); } public Texture3D GetValueTexture3D() { - return NativeParameter.GetValueTexture3D(); + return nativeParameter.GetValueTexture3D(); } public TextureCube GetValueTextureCube() { - return NativeParameter.GetValueTextureCube(); + return nativeParameter.GetValueTextureCube(); } public Vector2 GetValueVector2() { - return NativeParameter.GetValueVector2(); + return nativeParameter.GetValueVector2(); } public Vector2[] GetValueVector2Array(int count) { - return NativeParameter.GetValueVector2Array(count); + return nativeParameter.GetValueVector2Array(count); } public Vector3 GetValueVector3() { - return NativeParameter.GetValueVector3(); + return nativeParameter.GetValueVector3(); } public Vector3[] GetValueVector3Array(int count) { - return NativeParameter.GetValueVector3Array(count); + return nativeParameter.GetValueVector3Array(count); } public Vector4 GetValueVector4() { - return NativeParameter.GetValueVector4(); + return nativeParameter.GetValueVector4(); } public Vector4[] GetValueVector4Array(int count) { - return NativeParameter.GetValueVector4Array(count); + return nativeParameter.GetValueVector4Array(count); } #endregion #region SetValue public void SetValue([MarshalAs(UnmanagedType.U1)] bool value) { - NativeParameter.SetValue(value); + nativeParameter.SetValue(value); } public void SetValue(bool[] value) { - NativeParameter.SetValue(value); + nativeParameter.SetValue(value); } public void SetValue(int value) { - NativeParameter.SetValue(value); + nativeParameter.SetValue(value); } public void SetValue(int[] value) { - NativeParameter.SetValue(value); + nativeParameter.SetValue(value); } public void SetValue(Matrix value) { - NativeParameter.SetValue(value, false); + nativeParameter.SetValue(value, false); } public void SetValue(Matrix[] value) { - NativeParameter.SetValue(value, false); + nativeParameter.SetValue(value, false); } public void SetValue(Quaternion value) { - NativeParameter.SetValue(value); + nativeParameter.SetValue(value); } public void SetValue(Quaternion[] value) { - NativeParameter.SetValue(value); + nativeParameter.SetValue(value); } public void SetValue(float value) { - NativeParameter.SetValue(value); + nativeParameter.SetValue(value); } public void SetValue(float[] value) { - NativeParameter.SetValue(value); + nativeParameter.SetValue(value); } public void SetValue(string value) { - NativeParameter.SetValue(value); + nativeParameter.SetValue(value); } public void SetValue(Texture value) { - NativeParameter.SetValue(value); + nativeParameter.SetValue(value); } public void SetValue(Vector2 value) { - NativeParameter.SetValue(value); + nativeParameter.SetValue(value); } public void SetValue(Vector2[] value) { - NativeParameter.SetValue(value); + nativeParameter.SetValue(value); } public void SetValue(Vector3 value) { - NativeParameter.SetValue(value); + nativeParameter.SetValue(value); } public void SetValue(Vector3[] value) { - NativeParameter.SetValue(value); + nativeParameter.SetValue(value); } public void SetValue(Vector4 value) { - NativeParameter.SetValue(value); + nativeParameter.SetValue(value); } public void SetValue(Vector4[] value) { - NativeParameter.SetValue(value); + nativeParameter.SetValue(value); } public void SetValueTranspose(Matrix value) { - NativeParameter.SetValue(value, true); + nativeParameter.SetValue(value, true); } public void SetValueTranspose(Matrix[] value) { - NativeParameter.SetValue(value, true); + nativeParameter.SetValue(value, true); } #endregion } diff --git a/ANX.Framework/Graphics/EffectPass.cs b/ANX.Framework/Graphics/EffectPass.cs index a89bc620..d6b99619 100644 --- a/ANX.Framework/Graphics/EffectPass.cs +++ b/ANX.Framework/Graphics/EffectPass.cs @@ -12,25 +12,10 @@ namespace ANX.Framework.Graphics [TestState(TestStateAttribute.TestState.Untested)] public sealed class EffectPass { - private string name; - private EffectAnnotationCollection annotations; - private Effect parentEffect; + private readonly Effect parentEffect; - public string Name - { - get - { - return this.name; - } - } - - public EffectAnnotationCollection Annotations - { - get - { - return this.annotations; - } - } + public string Name { get; private set; } + public EffectAnnotationCollection Annotations { get; private set; } internal EffectPass(Effect parentEffect) { @@ -43,7 +28,7 @@ namespace ANX.Framework.Graphics public void Apply() { parentEffect.PreBindSetParameters(); - parentEffect.NativeEffect.Apply(this.parentEffect.GraphicsDevice); + parentEffect.NativeEffect.Apply(parentEffect.GraphicsDevice); } } } diff --git a/ANX.Framework/Graphics/EffectTechnique.cs b/ANX.Framework/Graphics/EffectTechnique.cs index 17c2042b..51bc1cb0 100644 --- a/ANX.Framework/Graphics/EffectTechnique.cs +++ b/ANX.Framework/Graphics/EffectTechnique.cs @@ -8,7 +8,7 @@ using ANX.Framework.NonXNA.Development; namespace ANX.Framework.Graphics { - [PercentageComplete(90)] + [PercentageComplete(100)] [Developer("Glatzemann")] [TestState(TestStateAttribute.TestState.Untested)] public sealed class EffectTechnique @@ -22,10 +22,7 @@ namespace ANX.Framework.Graphics public EffectAnnotationCollection Annotations { - get - { - throw new NotImplementedException(); - } + get { return NativeTechnique.Annotations; } } public EffectPassCollection Passes { get; private set; } diff --git a/ANX.Framework/Graphics/VertexElement.cs b/ANX.Framework/Graphics/VertexElement.cs index 2bcf3cf8..40651018 100644 --- a/ANX.Framework/Graphics/VertexElement.cs +++ b/ANX.Framework/Graphics/VertexElement.cs @@ -89,13 +89,10 @@ namespace ANX.Framework.Graphics public override bool Equals(object obj) { - if (obj != null && obj is VertexElement) - return this == (VertexElement)obj; - - return false; + return obj is VertexElement && this == (VertexElement)obj; } - public static bool operator ==(VertexElement lhs, VertexElement rhs) + public static bool operator ==(VertexElement lhs, VertexElement rhs) { return lhs.offset == rhs.offset && lhs.elementFormat == rhs.elementFormat && lhs.elementUsage == rhs.elementUsage && lhs.usageIndex == rhs.usageIndex; diff --git a/ANX.Framework/NonXNA/RenderSystem/INativeEffectAnnotation.cs b/ANX.Framework/NonXNA/RenderSystem/INativeEffectAnnotation.cs new file mode 100644 index 00000000..10914d8e --- /dev/null +++ b/ANX.Framework/NonXNA/RenderSystem/INativeEffectAnnotation.cs @@ -0,0 +1,31 @@ +using ANX.Framework.Graphics; +using ANX.Framework.NonXNA.Development; + +// 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 + +namespace ANX.Framework.NonXNA.RenderSystem +{ + [PercentageComplete(100)] + [Developer("AstrorEnales")] + [TestState(TestStateAttribute.TestState.Untested)] + public interface INativeEffectAnnotation + { + int ColumnCount { get; } + string Name { get; } + EffectParameterClass ParameterClass { get; } + EffectParameterType ParameterType { get; } + int RowCount { get; } + string Semantic { get; } + + bool GetValueBoolean(); + int GetValueInt32(); + Matrix GetValueMatrix(); + float GetValueSingle(); + string GetValueString(); + Vector2 GetValueVector2(); + Vector3 GetValueVector3(); + Vector4 GetValueVector4(); + } +} diff --git a/ANX.Framework/NonXNA/RenderSystem/INativeEffectParameter.cs b/ANX.Framework/NonXNA/RenderSystem/INativeEffectParameter.cs index 2942a6ba..b7155d30 100644 --- a/ANX.Framework/NonXNA/RenderSystem/INativeEffectParameter.cs +++ b/ANX.Framework/NonXNA/RenderSystem/INativeEffectParameter.cs @@ -22,6 +22,9 @@ namespace ANX.Framework.NonXNA int RowCount { get; } EffectParameterClass ParameterClass { get; } EffectParameterType ParameterType { get; } + EffectAnnotationCollection Annotations { get; } + EffectParameterCollection Elements { get; } + EffectParameterCollection StructureMembers { get; } #region GetValue bool GetValueBoolean(); diff --git a/ANX.Framework/NonXNA/RenderSystem/INativeEffectTechnique.cs b/ANX.Framework/NonXNA/RenderSystem/INativeEffectTechnique.cs index 988627ec..5c1df18f 100644 --- a/ANX.Framework/NonXNA/RenderSystem/INativeEffectTechnique.cs +++ b/ANX.Framework/NonXNA/RenderSystem/INativeEffectTechnique.cs @@ -14,7 +14,7 @@ namespace ANX.Framework.NonXNA public interface INativeEffectTechnique { string Name { get; } - IEnumerable Passes { get; } + EffectAnnotationCollection Annotations { get; } } } diff --git a/RenderSystems/ANX.Framework.GL3/EffectGL3.cs b/RenderSystems/ANX.Framework.GL3/EffectGL3.cs index 212d56a7..489cdf6d 100644 --- a/RenderSystems/ANX.Framework.GL3/EffectGL3.cs +++ b/RenderSystems/ANX.Framework.GL3/EffectGL3.cs @@ -214,12 +214,10 @@ namespace ANX.RenderSystem.GL3 #endregion #region AddParametersFrom - private void AddParametersFrom(int programHandle, List parameterNames, - EffectTechniqueGL3 technique) + private void AddParametersFrom(int programHandle, List parameterNames, EffectTechniqueGL3 technique) { int uniformCount; - GL.GetProgram(programHandle, ProgramParameter.ActiveUniforms, - out uniformCount); + GL.GetProgram(programHandle, ProgramParameter.ActiveUniforms, out uniformCount); ErrorHelper.Check("GetProgram ActiveUniforms"); for (int index = 0; index < uniformCount; index++) @@ -231,13 +229,8 @@ namespace ANX.RenderSystem.GL3 { parameterNames.Add(name); int uniformIndex = GL.GetUniformLocation(programHandle, name); - ErrorHelper.Check("GetUniformLocation name=" + name + - " uniformIndex=" + uniformIndex); - parameters.Add(new EffectParameter() - { - NativeParameter = - new EffectParameterGL3(technique, name, uniformIndex), - }); + ErrorHelper.Check("GetUniformLocation name=" + name + " uniformIndex=" + uniformIndex); + parameters.Add(new EffectParameter(new EffectParameterGL3(technique, name, uniformIndex))); } } } diff --git a/RenderSystems/ANX.Framework.GL3/EffectParameterGL3.cs b/RenderSystems/ANX.Framework.GL3/EffectParameterGL3.cs index 934fb4ef..de06faac 100644 --- a/RenderSystems/ANX.Framework.GL3/EffectParameterGL3.cs +++ b/RenderSystems/ANX.Framework.GL3/EffectParameterGL3.cs @@ -51,6 +51,21 @@ namespace ANX.RenderSystem.GL3 } public EffectParameterType ParameterType + { + get { throw new NotImplementedException(); } + } + + public EffectAnnotationCollection Annotations + { + get { throw new NotImplementedException(); } + } + + public EffectParameterCollection Elements + { + get { throw new NotImplementedException(); } + } + + public EffectParameterCollection StructureMembers { get { throw new NotImplementedException(); } } diff --git a/RenderSystems/ANX.Framework.GL3/EffectTechniqueGL3.cs b/RenderSystems/ANX.Framework.GL3/EffectTechniqueGL3.cs index 0edd9882..e945b7e2 100644 --- a/RenderSystems/ANX.Framework.GL3/EffectTechniqueGL3.cs +++ b/RenderSystems/ANX.Framework.GL3/EffectTechniqueGL3.cs @@ -1,3 +1,4 @@ +using System; using System.Collections.Generic; using ANX.Framework.Graphics; using ANX.Framework.NonXNA; @@ -34,25 +35,23 @@ namespace ANX.RenderSystem.GL3 #endregion #region Public - /// - /// The name of the effect technique. - /// - public string Name - { - get; - private set; - } + /// + /// The name of the effect technique. + /// + public string Name { get; private set; } - /// - /// The passes of the technique. - /// - public IEnumerable Passes - { - get - { - yield return pass; - } - } + /// + /// The passes of the technique. + /// + public IEnumerable Passes + { + get { yield return pass; } + } + + public EffectAnnotationCollection Annotations + { + get { throw new NotImplementedException(); } + } #endregion #region Constructor diff --git a/RenderSystems/ANX.RenderSystem.Windows.DX10/EffectDX.cs b/RenderSystems/ANX.RenderSystem.Windows.DX10/EffectDX.cs index 4d570c34..4d95a07f 100644 --- a/RenderSystems/ANX.RenderSystem.Windows.DX10/EffectDX.cs +++ b/RenderSystems/ANX.RenderSystem.Windows.DX10/EffectDX.cs @@ -42,15 +42,14 @@ namespace ANX.RenderSystem.Windows.DX10 { get { - for (int i = 0; i < NativeEffect.Description.GlobalVariableCount; i++) - { - EffectParameter_DX10 parDx10 = new EffectParameter_DX10(); - parDx10.NativeParameter = NativeEffect.GetVariableByIndex(i); - - EffectParameter par = new EffectParameter(); - par.NativeParameter = parDx10; - yield return par; - } + for (int i = 0; i < NativeEffect.Description.GlobalVariableCount; i++) + { + var parDx10 = new EffectParameter_DX10 + { + NativeParameter = NativeEffect.GetVariableByIndex(i) + }; + yield return new EffectParameter(parDx10); + } } } #endregion diff --git a/RenderSystems/ANX.RenderSystem.Windows.DX10/EffectParameter_DX10.cs b/RenderSystems/ANX.RenderSystem.Windows.DX10/EffectParameter_DX10.cs index 3fb58479..cbba830f 100644 --- a/RenderSystems/ANX.RenderSystem.Windows.DX10/EffectParameter_DX10.cs +++ b/RenderSystems/ANX.RenderSystem.Windows.DX10/EffectParameter_DX10.cs @@ -48,6 +48,21 @@ namespace ANX.RenderSystem.Windows.DX10 { get { return DxFormatConverter.Translate(NativeParameter.TypeInfo.Description.Type); } } + + public EffectAnnotationCollection Annotations + { + get { throw new NotImplementedException(); } + } + + public EffectParameterCollection Elements + { + get { throw new NotImplementedException(); } + } + + public EffectParameterCollection StructureMembers + { + get { throw new NotImplementedException(); } + } #endregion #region SetValue (bool) diff --git a/RenderSystems/ANX.RenderSystem.Windows.DX10/EffectTechnique_DX10.cs b/RenderSystems/ANX.RenderSystem.Windows.DX10/EffectTechnique_DX10.cs index f9bc87ea..6144ec63 100644 --- a/RenderSystems/ANX.RenderSystem.Windows.DX10/EffectTechnique_DX10.cs +++ b/RenderSystems/ANX.RenderSystem.Windows.DX10/EffectTechnique_DX10.cs @@ -16,7 +16,7 @@ namespace ANX.RenderSystem.Windows.DX10 { public class EffectTechnique_DX10 : INativeEffectTechnique { - private Effect parentEffect; + private readonly Effect parentEffect; public EffectTechnique_DX10(Effect parentEffect, Dx10.EffectTechnique nativeTechnique) { @@ -51,5 +51,10 @@ namespace ANX.RenderSystem.Windows.DX10 } } } + + public EffectAnnotationCollection Annotations + { + get { throw new NotImplementedException(); } + } } } diff --git a/RenderSystems/ANX.RenderSystem.Windows.DX11/EffectDX.cs b/RenderSystems/ANX.RenderSystem.Windows.DX11/EffectDX.cs index 0f65822b..068a1345 100644 --- a/RenderSystems/ANX.RenderSystem.Windows.DX11/EffectDX.cs +++ b/RenderSystems/ANX.RenderSystem.Windows.DX11/EffectDX.cs @@ -42,12 +42,11 @@ namespace ANX.RenderSystem.Windows.DX11 { for (int i = 0; i < NativeEffect.Description.GlobalVariableCount; i++) { - EffectParameter_DX11 parDx11 = new EffectParameter_DX11(); - parDx11.NativeParameter = NativeEffect.GetVariableByIndex(i); - - EffectParameter par = new EffectParameter(); - par.NativeParameter = parDx11; - yield return par; + var parDx11 = new EffectParameter_DX11 + { + NativeParameter = NativeEffect.GetVariableByIndex(i) + }; + yield return new EffectParameter(parDx11); } } } diff --git a/RenderSystems/ANX.RenderSystem.Windows.DX11/EffectParameter_DX11.cs b/RenderSystems/ANX.RenderSystem.Windows.DX11/EffectParameter_DX11.cs index 80c8d670..a6cd6aa0 100644 --- a/RenderSystems/ANX.RenderSystem.Windows.DX11/EffectParameter_DX11.cs +++ b/RenderSystems/ANX.RenderSystem.Windows.DX11/EffectParameter_DX11.cs @@ -48,6 +48,21 @@ namespace ANX.RenderSystem.Windows.DX11 { get { return DxFormatConverter.Translate(NativeParameter.TypeInfo.Description.Type); } } + + public EffectAnnotationCollection Annotations + { + get { throw new NotImplementedException(); } + } + + public EffectParameterCollection Elements + { + get { throw new NotImplementedException(); } + } + + public EffectParameterCollection StructureMembers + { + get { throw new NotImplementedException(); } + } #endregion #region SetValue (bool) diff --git a/RenderSystems/ANX.RenderSystem.Windows.DX11/EffectTechnique_DX11.cs b/RenderSystems/ANX.RenderSystem.Windows.DX11/EffectTechnique_DX11.cs index dac46ef9..beb0f66a 100644 --- a/RenderSystems/ANX.RenderSystem.Windows.DX11/EffectTechnique_DX11.cs +++ b/RenderSystems/ANX.RenderSystem.Windows.DX11/EffectTechnique_DX11.cs @@ -16,7 +16,7 @@ namespace ANX.RenderSystem.Windows.DX11 { public class EffectTechnique_DX11 : INativeEffectTechnique { - private Effect parentEffect; + private readonly Effect parentEffect; public EffectTechnique_DX11(Effect parentEffect, Dx11.EffectTechnique nativeTechnique) { @@ -51,5 +51,10 @@ namespace ANX.RenderSystem.Windows.DX11 } } } - } + + public EffectAnnotationCollection Annotations + { + get { throw new NotImplementedException(); } + } + } } diff --git a/RenderSystems/ANX.RenderSystem.Windows.Metro/EffectParameter_Metro.cs b/RenderSystems/ANX.RenderSystem.Windows.Metro/EffectParameter_Metro.cs index 7e2dbd81..7529ff91 100644 --- a/RenderSystems/ANX.RenderSystem.Windows.Metro/EffectParameter_Metro.cs +++ b/RenderSystems/ANX.RenderSystem.Windows.Metro/EffectParameter_Metro.cs @@ -50,6 +50,21 @@ namespace ANX.RenderSystem.Windows.Metro } public EffectParameterType ParameterType + { + get { throw new NotImplementedException(); } + } + + public EffectAnnotationCollection Annotations + { + get { throw new NotImplementedException(); } + } + + public EffectParameterCollection Elements + { + get { throw new NotImplementedException(); } + } + + public EffectParameterCollection StructureMembers { get { throw new NotImplementedException(); } } diff --git a/RenderSystems/ANX.RenderSystem.Windows.Metro/EffectTechnique_Metro.cs b/RenderSystems/ANX.RenderSystem.Windows.Metro/EffectTechnique_Metro.cs index 81c4e6cd..ca7dcd47 100644 --- a/RenderSystems/ANX.RenderSystem.Windows.Metro/EffectTechnique_Metro.cs +++ b/RenderSystems/ANX.RenderSystem.Windows.Metro/EffectTechnique_Metro.cs @@ -1,3 +1,4 @@ +using System; using System.Collections.Generic; using ANX.Framework.Graphics; using ANX.Framework.NonXNA; @@ -41,12 +42,14 @@ namespace ANX.RenderSystem.Windows.Metro } } - public EffectPass_Metro this[int index] + public EffectPass_Metro this[int index] + { + get { return passes[index]; } + } + + public EffectAnnotationCollection Annotations { - get - { - return passes[index]; - } + get { throw new NotImplementedException(); } } #endregion diff --git a/RenderSystems/ANX.RenderSystem.Windows.Metro/Effect_Metro.cs b/RenderSystems/ANX.RenderSystem.Windows.Metro/Effect_Metro.cs index a8726b48..6d9aa7ab 100644 --- a/RenderSystems/ANX.RenderSystem.Windows.Metro/Effect_Metro.cs +++ b/RenderSystems/ANX.RenderSystem.Windows.Metro/Effect_Metro.cs @@ -101,11 +101,7 @@ namespace ANX.RenderSystem.Windows.Metro parameters = new List(); foreach (ExtendedShaderParameter parameter in shader.Parameters) - { - EffectParameter newParam = new EffectParameter(); - newParam.NativeParameter = new EffectParameter_Metro(this, parameter); - parameters.Add(newParam); - } + parameters.Add(new EffectParameter(new EffectParameter_Metro(this, parameter))); paramBuffer = new ParameterBuffer(this, NativeDxDevice.Current); }