/// <summary> /// [XEN EXTENSION] Draw an XNA vertex buffer, with blended animation /// </summary> public static void DrawBlending(this VertexBuffer vb, DrawState state, IndexBuffer indices, PrimitiveType primitiveType, Graphics.AnimationTransformArray animationTransforms, int baseVertex, int numVertices, int primitiveCount, int startIndex) { if (state == null) throw new ArgumentNullException(); state.graphics.SetVertexBuffer(vb); if (indices != null) { state.DrawIndexedPrimitives(vb.VertexCount, indices, indices.IndexCount, primitiveType, baseVertex, 0, numVertices, startIndex, primitiveCount, animationTransforms, animationTransforms == null ? Xen.Graphics.ShaderSystem.ShaderExtension.None : Xen.Graphics.ShaderSystem.ShaderExtension.Blending, null, vb.VertexDeclaration, -1); } else state.DrawPrimitives(vb.VertexCount, primitiveType, baseVertex, primitiveCount, animationTransforms, animationTransforms == null ? Xen.Graphics.ShaderSystem.ShaderExtension.None : Xen.Graphics.ShaderSystem.ShaderExtension.Blending, null, vb.VertexDeclaration); }
/// <summary> /// [XEN EXTENSION] Draw an XNA vertex buffer, with blended animation /// </summary> public static void DrawBlending(this VertexBuffer vb, DrawState state, IndexBuffer indices, PrimitiveType primitiveType, Graphics.AnimationTransformArray animationTransforms) { if (state == null) throw new ArgumentNullException(); state.graphics.SetVertexBuffer(vb); if (indices != null) { int size = indices.IndexElementSize == IndexElementSize.SixteenBits ? 2 : 4; state.DrawIndexedPrimitives(vb.VertexCount, indices, indices.IndexCount, primitiveType, 0, 0, vb.VertexCount, 0, -1, animationTransforms, animationTransforms == null ? Xen.Graphics.ShaderSystem.ShaderExtension.None : Xen.Graphics.ShaderSystem.ShaderExtension.Blending, null, vb.VertexDeclaration, -1); } else state.DrawPrimitives(vb.VertexCount, primitiveType, 0, -1, animationTransforms, animationTransforms == null ? Xen.Graphics.ShaderSystem.ShaderExtension.None : Xen.Graphics.ShaderSystem.ShaderExtension.Blending, null, vb.VertexDeclaration); }
/// <summary> /// [XEN EXTENSION] Draw an XNA vertex buffer /// </summary> public static void Draw(this VertexBuffer vb, DrawState state, IndexBuffer indices, PrimitiveType primitiveType) { if (state == null) throw new ArgumentNullException(); state.graphics.SetVertexBuffer(vb); if (indices != null) { state.DrawIndexedPrimitives(vb.VertexCount, indices, indices.IndexCount, primitiveType, 0, 0, vb.VertexCount, 0, -1, null, Xen.Graphics.ShaderSystem.ShaderExtension.None, null, vb.VertexDeclaration, -1); } else state.DrawPrimitives(vb.VertexCount, primitiveType, 0, -1, null, Xen.Graphics.ShaderSystem.ShaderExtension.None, null, vb.VertexDeclaration); }