Time and again I have seen code like this used in XNA tutorials.
effectDrawBlock.Begin();
foreach (EffectPass pass in effectDrawBlock.CurrentTechnique.Passes)
{
pass.Begin();
gd.DrawIndexedPrimitives(PrimitiveType.TriangleStrip, 0, 0, 35, 0, 70);
pass.End();
}
effectDrawBlock.End();
When you use a foreach over an array of ints, you will not create garbage, and it’s fast, so that’s [...]