public void Render2DTransformedBox( float x1, float y1, float x2, float y2, int color ) { CustomVertex.TransformedColoredTextured[ ] vertices = new CustomVertex.TransformedColoredTextured[ 4 ]; vertices[ 0 ] = new CustomVertex.TransformedColoredTextured( x1, y1, 0, 1, color, 0, 0 ); vertices[ 1 ] = new CustomVertex.TransformedColoredTextured( x1, y1, 0, 1, color, 1, 0 ); vertices[ 2 ] = new CustomVertex.TransformedColoredTextured( x1, y1, 0, 1, color, 1, 1 ); vertices[ 3 ] = new CustomVertex.TransformedColoredTextured( x1, y1, 0, 1, color, 0, 1 ); VB_2D.SetData( vertices ); this.EngineDevice.D3DDevice.SetStreamSource( 0, VB_2D.VertexBuffer, 0 ); this.EngineDevice.D3DDevice.DrawPrimitives( PrimitiveType.TriangleFan, 0, 2 ); }