implemented DrawInstancedPrimitives for RenderSystem DX10 and DX11 (currently untested)

Primitives sample is now rendering (issue #531) but BasicEffect is not complete
This commit is contained in:
Glatzemann 2012-01-19 05:57:54 +00:00
parent b3602239d9
commit 8ff04fef2e
4 changed files with 22 additions and 8 deletions

View File

@ -318,7 +318,7 @@ namespace ANX.Framework.Windows.DX10
#region DrawInstancedPrimitives
public void DrawInstancedPrimitives(PrimitiveType primitiveType, int baseVertex, int minVertexIndex, int numVertices, int startIndex, int primitiveCount, int instanceCount)
{
throw new NotImplementedException();
device.DrawIndexedInstanced(numVertices, instanceCount, startIndex, baseVertex, 0);
}
#endregion // DrawInstancedPrimitives
@ -336,7 +336,14 @@ namespace ANX.Framework.Windows.DX10
device.InputAssembler.SetVertexBuffers(0, nativeVertexBufferBindings);
IndexBuffer_DX10 idx10 = new IndexBuffer_DX10(this.device, indexFormat, indexCount, BufferUsage.None);
idx10.SetData<int>(null, (int[])indexData);
if (indexData.GetType() == typeof(Int16[]))
{
idx10.SetData<short>(null, (short[])indexData);
}
else
{
idx10.SetData<int>(null, (int[])indexData);
}
DrawIndexedPrimitives(primitiveType, 0, vertexOffset, numVertices, indexOffset, primitiveCount);
}

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.13.0")]
[assembly: AssemblyFileVersion("0.7.13.0")]
[assembly: AssemblyVersion("0.7.14.0")]
[assembly: AssemblyFileVersion("0.7.14.0")]
[assembly: InternalsVisibleTo("ANX.Framework.ContentPipeline")]

View File

@ -322,7 +322,7 @@ namespace ANX.RenderSystem.Windows.DX11
#region DrawInstancedPrimitives
public void DrawInstancedPrimitives(PrimitiveType primitiveType, int baseVertex, int minVertexIndex, int numVertices, int startIndex, int primitiveCount, int instanceCount)
{
throw new NotImplementedException();
deviceContext.DrawIndexedInstanced(numVertices, instanceCount, startIndex, baseVertex, 0);
}
#endregion // DrawInstancedPrimitives
@ -340,7 +340,14 @@ namespace ANX.RenderSystem.Windows.DX11
deviceContext.InputAssembler.SetVertexBuffers(0, nativeVertexBufferBindings);
IndexBuffer_DX11 idx10 = new IndexBuffer_DX11(this.deviceContext.Device, indexFormat, indexCount, BufferUsage.None);
idx10.SetData<int>(null, (int[])indexData);
if (indexData.GetType() == typeof(Int16[]))
{
idx10.SetData<short>(null, (short[])indexData);
}
else
{
idx10.SetData<int>(null, (int[])indexData);
}
DrawIndexedPrimitives(primitiveType, 0, vertexOffset, numVertices, indexOffset, primitiveCount);
}

View File

@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
// Buildnummer
// Revision
//
[assembly: AssemblyVersion("0.7.5.0")]
[assembly: AssemblyFileVersion("0.7.5.0")]
[assembly: AssemblyVersion("0.7.6.0")]
[assembly: AssemblyFileVersion("0.7.6.0")]