   Problem with SetStreamSource()
  Hi, I'm trying to use the SetStreamSource() function but I am encountering a problem. To get the vertext buffer from my mesh I am using:m_mesh->GetVertexBuffer(m_VertexBuffer);However, for this function to return the value to the parameter my m_VertexBuffer must be of type LPDIRECT3DVERTEXBUFFER9*.  This is causing a problem when I try to call the SetStreamSource function like so:d3dDevice->SetStreamSource( 0, m_VertexBuffer, 0,    m_mesh->GetNumBytesPerVertex())as the vertex buffer that needs to be passed has to be a IDirect3DVertexBuffer9 * so it is throwing up an error.Anybody any ideas please????Thanks   
  You'd make m_VertexBuffer of type LPDIRECT3DVERTEXBUFFER9 then pass it to GetVertexBuffer like this:m_mesh->GetVertexBuffer(&m_VertexBuffer);However, you'd normally render from a mesh using the mesh's DrawSubset() method and I don't know what the implications would be for rendering it directly - shouldn't cause a problem I guess.Defining an LPDIRECT3DVERTEXBUFFER9* then passing it to GetVertexBuffer() is a bad idea - you are passing in a pointer-to-pointer that is not actually pointing to a pointer, so when GetVertexBuffer() dereferences in order to fill in the pointer, you're into undefined behaviour.   ; Cross post. Closed.   