Original Post
I am trying to draw a line whose start point is fixed at origin and the end point will be set to the last mouse click point. My problem is the line's end point is not updated on the screen. I think the following are main steps to do this 1. m_d3d.Device.CreateVertexBuffer 2. Set the data to the vertex buffer (D3DVertexBuffer8SetData) 3. m_d3d.Device.SetStreamSource 4. m_d3d.Device.DrawPrimitive I am calling the step 1 & 2 during the line creation. step 3 & 4 are called in the renderline() function. Whenever I click a new point using the mouse, I update the vertex's x, y, z values and renderline() gets called. In this case the vertex buffer still has only the old values and keeps drawing the line with the original values. Is this right? In order to make the drawing code use the updated vertex's x, y, z values should i call both step 1 & step 2 everytime mouse is clicked or step 2 alone is sufficient?