var blendedFillColor = /* color remains the same, just changing the alpha value */;
var vertices = (CustomVertex.TransformedColored[])_vertexBuffer.Lock(0, 0);
for (int vertexIndex = 0; vertexIndex < 4; vertexIndex++)
{
vertices[vertexIndex].Color = blendedFillColor.ToArgb();
}
_vertexBuffer.Unlock();
dxDevice.SetStreamSource(0, _vertexBuffer, 0);
dxDevice.VertexFormat = CustomVertex.TransformedColored.Format;
dxDevice.DrawPrimitives(PrimitiveType.TriangleStrip, 0, 2);
Is Lock() and Unlock() operation on the vertex buffer a performance hit? And also can I avoid it in my case?






