Added some more EffectParameters. Implemented native methods in RenderSystemDX10 (testing needed).

This commit is contained in:
Glatzemann 2011-11-26 07:55:56 +00:00
parent 61d4c7ab0a
commit 122a731868
5 changed files with 228 additions and 20 deletions

View File

@ -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)

View File

@ -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);
}
}

View File

@ -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

View File

@ -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")]

View File

@ -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();
}
}
}