CHAPTER 5 ■ GETTING THE MOST OUT OF VERTICES
405
protected override void Draw(GameTime gameTime)
{
device.Clear(ClearOptions.Target | ClearOptions.DepthBuffer,
➥
Color.CornflowerBlue, 1, 0);
cCross.Draw(fpsCam.ViewMatrix, fpsCam.ProjectionMatrix);
//draw triangles
device.RenderState.CullMode = CullMode.None;
basicEffect.World = Matrix.Identity;
basicEffect.View = fpsCam.ViewMatrix;
basicEffect.Projection = fpsCam.ProjectionMatrix;
basicEffect.VertexColorEnabled = true;
basicEffect.Begin();
foreach (EffectPass pass in basicEffect.CurrentTechnique.Passes)
{
pass.Begin();
device.VertexDeclaration = myVertexDeclaration;
device.DrawUserPrimitives<VertexPositionColor>
➥
(PrimitiveType.TriangleStrip, vertices, 0, 10);
pass.End();
}
basicEffect.End(); ...