All pastes #625702 Raw Edit

Someone

public text v1 · immutable
·published 2007-07-19 03:28 UTC
rendered paste body
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 );
        }