git-svn-id: svn://svn.ijw.co.nz/svn/OpenRa@1156 993157c7-ee19-0410-b2c4-bb4e9862e678

This commit is contained in:
chrisf
2007-07-10 06:08:38 +00:00
parent d10f9eab9a
commit d42b2f45e5
2 changed files with 45 additions and 4 deletions

View File

@@ -2,6 +2,20 @@
namespace BluntDirectX { namespace Direct3D
{
generic< typename T >
public value class Range
{
T start, end;
public:
Range( T start, T end )
: start( start ), end( end )
{
}
property T Start { T get() { return start; } }
property T End { T get() { return end; } }
};
public ref class GraphicsDevice
{
private:
@@ -164,5 +178,12 @@ namespace BluntDirectX { namespace Direct3D
{
device->DrawIndexedPrimitive( (D3DPRIMITIVETYPE)primtype, 0, 0, vertexPoolSize, 0, numPrimitives );
}
void DrawIndexedPrimitives(PrimitiveType primType, Range<int> vertices, Range<int> indices)
{
device->DrawIndexedPrimitive( (D3DPRIMITIVETYPE)primType,
0, vertices.Start, vertices.End - vertices.Start,
indices.Start, (indices.End - indices.Start) / 3 );
}
};
}}