git-svn-id: svn://svn.ijw.co.nz/svn/OpenRa@1156 993157c7-ee19-0410-b2c4-bb4e9862e678
This commit is contained in:
@@ -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 );
|
||||
}
|
||||
};
|
||||
}}
|
||||
|
||||
Reference in New Issue
Block a user