diff --git a/ANX.Framework/Graphics/EffectParameter.cs b/ANX.Framework/Graphics/EffectParameter.cs index fba8a995..ae248fa1 100644 --- a/ANX.Framework/Graphics/EffectParameter.cs +++ b/ANX.Framework/Graphics/EffectParameter.cs @@ -184,22 +184,22 @@ namespace ANX.Framework.Graphics public void SetValue(bool value) { - throw new NotImplementedException(); + nativeParameter.SetValue(value); } public void SetValue(bool[] value) { - throw new NotImplementedException(); + nativeParameter.SetValue(value); } public void SetValue(int value) { - throw new NotImplementedException(); + nativeParameter.SetValue(value); } public void SetValue(int[] value) { - throw new NotImplementedException(); + nativeParameter.SetValue(value); } public void SetValue(Matrix value) @@ -209,27 +209,27 @@ namespace ANX.Framework.Graphics public void SetValue(Matrix[] value) { - throw new NotImplementedException(); + nativeParameter.SetValue(value); } public void SetValue(Quaternion value) { - throw new NotImplementedException(); + nativeParameter.SetValue(value); } public void SetValue(Quaternion[] value) { - throw new NotImplementedException(); + nativeParameter.SetValue(value); } public void SetValue(float value) { - throw new NotImplementedException(); + nativeParameter.SetValue(value); } public void SetValue(float[] value) { - throw new NotImplementedException(); + nativeParameter.SetValue(value); } public void SetValue(string value) @@ -244,32 +244,32 @@ namespace ANX.Framework.Graphics public void SetValue(Vector2 value) { - throw new NotImplementedException(); + nativeParameter.SetValue(value); } public void SetValue(Vector2[] value) { - throw new NotImplementedException(); + nativeParameter.SetValue(value); } public void SetValue(Vector3 value) { - throw new NotImplementedException(); + nativeParameter.SetValue(value); } public void SetValue(Vector3[] value) { - throw new NotImplementedException(); + nativeParameter.SetValue(value); } public void SetValue(Vector4 value) { - throw new NotImplementedException(); + nativeParameter.SetValue(value); } public void SetValue(Vector4[] value) { - throw new NotImplementedException(); + nativeParameter.SetValue(value); } public void SetValueTranspose(Matrix value) diff --git a/ANX.Framework/NonXNA/RenderSystem/INativeEffectParameter.cs b/ANX.Framework/NonXNA/RenderSystem/INativeEffectParameter.cs index 12e444d1..02a5549c 100644 --- a/ANX.Framework/NonXNA/RenderSystem/INativeEffectParameter.cs +++ b/ANX.Framework/NonXNA/RenderSystem/INativeEffectParameter.cs @@ -57,8 +57,38 @@ namespace ANX.Framework.NonXNA { string Name { get; } + void SetValue(bool value); + + void SetValue(bool[] value); + + void SetValue(int value); + + void SetValue(int[] value); + void SetValue(Matrix value); + void SetValue(Matrix[] value); + + void SetValue(Quaternion value); + + void SetValue(Quaternion[] value); + + void SetValue(float value); + + void SetValue(float[] value); + + void SetValue(Vector2 value); + + void SetValue(Vector2[] value); + + void SetValue(Vector3 value); + + void SetValue(Vector3[] value); + + void SetValue(Vector4 value); + + void SetValue(Vector4[] value); + void SetValue(Texture value); } } diff --git a/RenderSystems/ANX.Framework.Windows.DX10/EffectParameter_DX10.cs b/RenderSystems/ANX.Framework.Windows.DX10/EffectParameter_DX10.cs index 1fa6b98b..66b78ad1 100644 --- a/RenderSystems/ANX.Framework.Windows.DX10/EffectParameter_DX10.cs +++ b/RenderSystems/ANX.Framework.Windows.DX10/EffectParameter_DX10.cs @@ -75,6 +75,25 @@ namespace ANX.Framework.Windows.DX10 } } + public void SetValue(bool value) + { + nativeEffectVariable.AsScalar().Set(value); + } + + public void SetValue(bool[] value) + { + nativeEffectVariable.AsScalar().Set(value); + } + + public void SetValue(int value) + { + nativeEffectVariable.AsScalar().Set(value); + } + + public void SetValue(int[] value) + { + nativeEffectVariable.AsScalar().Set(value); + } public void SetValue(Matrix value) { @@ -82,17 +101,100 @@ namespace ANX.Framework.Windows.DX10 nativeEffectVariable.AsMatrix().SetMatrix(m); } + public void SetValue(Matrix[] value) + { + int count = value.Length; + SharpDX.Matrix[] m = new SharpDX.Matrix[count]; + Matrix anxMatrix; + for (int i = 0; i < count; i++) + { + anxMatrix = value[i]; + m[i] = new SharpDX.Matrix(anxMatrix.M11, anxMatrix.M12, anxMatrix.M13, anxMatrix.M14, + anxMatrix.M21, anxMatrix.M22, anxMatrix.M23, anxMatrix.M24, + anxMatrix.M31, anxMatrix.M32, anxMatrix.M33, anxMatrix.M34, + anxMatrix.M41, anxMatrix.M42, anxMatrix.M43, anxMatrix.M44); + } + + nativeEffectVariable.AsMatrix().SetMatrix(m); + } + + public void SetValue(Quaternion value) + { + SharpDX.Vector4 q = new SharpDX.Vector4(value.X, value.Y, value.Z, value.W); + nativeEffectVariable.AsVector().Set(q); + } + + public void SetValue(Quaternion[] value) + { + int count = value.Length; + SharpDX.Vector4[] q = new SharpDX.Vector4[count]; + for (int i = 0; i < count; i++) + { + q[i] = new SharpDX.Vector4(value[i].X, value[i].Y, value[i].Z, value[i].W); + } + nativeEffectVariable.AsVector().Set(q); + } + + public void SetValue(float value) + { + nativeEffectVariable.AsScalar().Set(value); + } + + public void SetValue(float[] value) + { + nativeEffectVariable.AsScalar().Set(value); + } + + public void SetValue(Vector2 value) + { + SharpDX.Vector2 v = new SharpDX.Vector2(value.X, value.Y); + nativeEffectVariable.AsVector().Set(v); + } + + public void SetValue(Vector2[] value) + { + throw new NotImplementedException(); + } + + public void SetValue(Vector3 value) + { + SharpDX.Vector3 v = new SharpDX.Vector3(value.X, value.Y, value.Z); + nativeEffectVariable.AsVector().Set(v); + } + + public void SetValue(Vector3[] value) + { + throw new NotImplementedException(); + } + + public void SetValue(Vector4 value) + { + SharpDX.Vector4 v = new SharpDX.Vector4(value.X, value.Y, value.Z, value.W); + nativeEffectVariable.AsVector().Set(v); + } + + public void SetValue(Vector4[] value) + { + int count = value.Length; + SharpDX.Vector4[] q = new SharpDX.Vector4[count]; + for (int i = 0; i < count; i++) + { + q[i] = new SharpDX.Vector4(value[i].X, value[i].Y, value[i].Z, value[i].W); + } + nativeEffectVariable.AsVector().Set(q); + } + public void SetValue(Texture value) { Texture2D_DX10 tex = value.NativeTexture as Texture2D_DX10; GraphicsDeviceWindowsDX10 graphicsDX10 = tex.GraphicsDevice.NativeDevice as GraphicsDeviceWindowsDX10; SharpDX.Direct3D10.Device device = graphicsDX10.NativeDevice; - //ShaderResourceView srv = new ShaderResourceView(device, tex.NativeTexture); - //nativeEffectVariable.AsShaderResource().SetResource(srv); nativeEffectVariable.AsShaderResource().SetResource(tex.NativeShaderResourceView); } + + public string Name { get diff --git a/RenderSystems/ANX.Framework.Windows.DX10/Properties/AssemblyInfo.cs b/RenderSystems/ANX.Framework.Windows.DX10/Properties/AssemblyInfo.cs index 7f41ea4f..a7d49b8a 100644 --- a/RenderSystems/ANX.Framework.Windows.DX10/Properties/AssemblyInfo.cs +++ b/RenderSystems/ANX.Framework.Windows.DX10/Properties/AssemblyInfo.cs @@ -32,7 +32,7 @@ using System.Runtime.InteropServices; // Sie können alle Werte angeben oder die standardmäßigen Build- und Revisionsnummern // übernehmen, indem Sie "*" eingeben: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("0.7.6.0")] -[assembly: AssemblyFileVersion("0.7.6.0")] +[assembly: AssemblyVersion("0.7.7.0")] +[assembly: AssemblyFileVersion("0.7.7.0")] [assembly: InternalsVisibleTo("ANX.Framework.ContentPipeline")] diff --git a/RenderSystems/ANX.Framework.Windows.GL3/EffectParameterGL3.cs b/RenderSystems/ANX.Framework.Windows.GL3/EffectParameterGL3.cs index 9736810f..ef200176 100644 --- a/RenderSystems/ANX.Framework.Windows.GL3/EffectParameterGL3.cs +++ b/RenderSystems/ANX.Framework.Windows.GL3/EffectParameterGL3.cs @@ -143,5 +143,81 @@ namespace ANX.Framework.Windows.GL3 } } #endregion - } + + + public void SetValue(bool value) + { + throw new NotImplementedException(); + } + + public void SetValue(bool[] value) + { + throw new NotImplementedException(); + } + + public void SetValue(int value) + { + throw new NotImplementedException(); + } + + public void SetValue(int[] value) + { + throw new NotImplementedException(); + } + + public void SetValue(Matrix[] value) + { + throw new NotImplementedException(); + } + + public void SetValue(Quaternion value) + { + throw new NotImplementedException(); + } + + public void SetValue(Quaternion[] value) + { + throw new NotImplementedException(); + } + + public void SetValue(float value) + { + throw new NotImplementedException(); + } + + public void SetValue(float[] value) + { + throw new NotImplementedException(); + } + + public void SetValue(Vector2 value) + { + throw new NotImplementedException(); + } + + public void SetValue(Vector2[] value) + { + throw new NotImplementedException(); + } + + public void SetValue(Vector3 value) + { + throw new NotImplementedException(); + } + + public void SetValue(Vector3[] value) + { + throw new NotImplementedException(); + } + + public void SetValue(Vector4 value) + { + throw new NotImplementedException(); + } + + public void SetValue(Vector4[] value) + { + throw new NotImplementedException(); + } + } }