예제 #1
0
        /// <summary>
        /// Sends the triangle list to the graphics device. Here is where the actual drawing starts.
        /// </summary>
        /// <param name="start">Start index of vertices to draw. Not used except to compute the count of vertices to draw.</param>
        /// <param name="end">End index of vertices to draw. Not used except to compute the count of vertices to draw.</param>
        private void FlushVertexArray(int start, int end)
        {
            if (start == end)
            {
                return;
            }

            var vertexCount = end - start;

            // We are now assuming we effects are set in advance

            //var passes = effect.CurrentTechnique.Passes;
            //foreach (var pass in passes)
            //{
            //    pass.Apply();
            //effect.OnApply();
            //_device.DrawUserIndexedPrimitives(
            //	PrimitiveType.TriangleList,
            //	_vertexArray,
            //	0,
            //	vertexCount,
            //	_index,
            //	0,
            //	(vertexCount / 4) * 2,
            //	VertexPositionColorTexture.VertexDeclaration);

            //_vertexArray.Trim(vertexCount);
            _device.DrawSpritePrimitives(
                _vertexArray,
                vertexCount);
            //}
        }