From b5627d0bb22fe83beffc449ba45402bcfd19c646 Mon Sep 17 00:00:00 2001 From: chrisf Date: Tue, 2 Oct 2007 12:12:13 +0000 Subject: [PATCH] git-svn-id: svn://svn.ijw.co.nz/svn/OpenRa@1721 993157c7-ee19-0410-b2c4-bb4e9862e678 --- BluntDx/GraphicsDevice.h | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/BluntDx/GraphicsDevice.h b/BluntDx/GraphicsDevice.h index 153de77294..a59c8964e6 100644 --- a/BluntDx/GraphicsDevice.h +++ b/BluntDx/GraphicsDevice.h @@ -174,19 +174,22 @@ namespace BluntDirectX { namespace Direct3D void DrawPrimitives(PrimitiveType primtype, int count) { - device->DrawPrimitive( (D3DPRIMITIVETYPE)primtype, 0, count ); + if (FAILED(device->DrawPrimitive( (D3DPRIMITIVETYPE)primtype, 0, count ))) + throw gcnew InvalidOperationException("Failure"); } void DrawIndexedPrimitives(PrimitiveType primtype, int vertexPoolSize, int numPrimitives) { - device->DrawIndexedPrimitive( (D3DPRIMITIVETYPE)primtype, 0, 0, vertexPoolSize, 0, numPrimitives ); + if (FAILED(device->DrawIndexedPrimitive( (D3DPRIMITIVETYPE)primtype, 0, 0, vertexPoolSize, 0, numPrimitives ))) + throw gcnew InvalidOperationException("Failure"); } void DrawIndexedPrimitives(PrimitiveType primType, Range vertices, Range indices) { - device->DrawIndexedPrimitive( (D3DPRIMITIVETYPE)primType, + if (FAILED(device->DrawIndexedPrimitive( (D3DPRIMITIVETYPE)primType, 0, vertices.Start, vertices.End - vertices.Start, - indices.Start, (indices.End - indices.Start) / 3 ); + indices.Start, (indices.End - indices.Start) / 3 ))) + throw gcnew InvalidOperationException("Failure"); } }; }}