/// <summary> /// Creates a new rendering operation if the drawing context or primitive type /// have changed since the last call /// </summary> /// <param name="type">Primitive type of the upcoming vertices</param> /// <param name="context">Drawing context used by the upcoming vertices</param> private void createNewOperationIfNecessary(PrimitiveType type, DrawContext context) { // If the currently running context is not identical to the one this // drawing call uses, we need to set up a new RenderOperation if ( (!context.Equals(this.currentOperation.DrawContext)) || (type != this.currentOperation.PrimitiveType) || (this.currentOperation.PrimitiveType == PrimitiveType.LineStrip) || (this.currentOperation.PrimitiveType == PrimitiveType.TriangleStrip) ) { this.currentOperation = new RenderOperation( this.currentOperation.EndIndex, type, context ); this.currentOperation.BaseVertexIndex = this.usedVertexCount; this.operations.Add(this.currentOperation); } }