There seem to be a few different ways to do it. The first one I learned is this:
Code:
//IDirect3DDevice9::CreateVertexBuffer()
//lock vertex buffer
//mem copy
//unlock vertex buffer
//begin scene
//SetTransform()s
//SetStreamSource()
//DrawPrimitive()
//end scene
I understand that pretty well, however, now I'm seeing this in a tutorial, and I'm wondering if there is some advantage/difference with doing it this way. I'm also having a bit of difficulty understanding this second way.
Code:
//IDirect3DDevice9::CreateVertexBuffer()
//SetStreamSource()
//SetVertexShader()
//ProcessVertices()
//begin scene
//SetTransform()s
//SetStreamSource()
//SetVertexShader()
//DrawPrimitive()
I think I've probably left something out of that second one or messed something up... but the real question involves SetVertexShader() and ProcessVertices(). I think that is creating a vertex buffer filled with vertices that have already been transformed. Is there any advantage to this? At all? It seems like it would just take up memory. I must be missing something. Can someone clarify it a bit?