GraphicsDevice device = basicEffect.GraphicsDevice;
device.DepthStencilState = m_depth_stencil;
device.RasterizerState = m_rasterizer_state;
device.BlendState = m_blend_state;
device.SamplerStates[0] = SamplerState.AnisotropicClamp;
// Set our vertex declaration, vertex buffer, and index buffer.
device.SetVertexBuffer(vertexBuffer);
device.Indices = indexBuffer;
// Step through the indexed mesh a face at a time changing the texture each time
basicEffect.Texture = m_cube_faces[0];
basicEffect.CurrentTechnique.Passes[0].Apply();
device.DrawIndexedPrimitives(PrimitiveType.TriangleList, 0, 0, vertices.Count, 0, 2);
basicEffect.Texture = m_cube_faces[1];
basicEffect.CurrentTechnique.Passes[0].Apply();
device.DrawIndexedPrimitives(PrimitiveType.TriangleList, 0, 0, vertices.Count, 6, 2);
basicEffect.Texture = m_cube_faces[2];
basicEffect.CurrentTechnique.Passes[0].Apply();
device.DrawIndexedPrimitives(PrimitiveType.TriangleList, 0, 0, vertices.Count, 12, 2);
basicEffect.Texture = m_cube_faces[3];
basicEffect.CurrentTechnique.Passes[0].Apply();
device.DrawIndexedPrimitives(PrimitiveType.TriangleList, 0, 0, vertices.Count, 18, 2);
basicEffect.Texture = m_cube_faces[4];
basicEffect.CurrentTechnique.Passes[0].Apply();
device.DrawIndexedPrimitives(PrimitiveType.TriangleList, 0, 0, vertices.Count, 24, 2);
basicEffect.Texture = m_cube_faces[5];
basicEffect.CurrentTechnique.Passes[0].Apply();
device.DrawIndexedPrimitives(PrimitiveType.TriangleList, 0, 0, vertices.Count, 30, 2);