Original Post
I'm trying to learn Vertex / Index buffers better since I don't understand them at all (any article suggestions would be appreciated). Anyways, I am trying to draw one triangle onto the screen and the Debugged output says (ERROR) : Stream 0 does not have required number of vertices (ERROR) : DrawPrimitive failed. Here's my three vertices and my calls Thanks, Carl
Device->CreateVertexBuffer(3 * sizeof(Vertex), D3DUSAGE_WRITEONLY, FVF_VERTEX, D3DPOOL_MANAGED, &VB, 0);
Vertex* v;
VB->Lock(0, 0, (void**)&v, 0);
v[0] = Vertex(0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f);
v[1] = Vertex(2.0f, 2.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f);
v[2] = Vertex(-1.0f, -1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f);
VB->Unlock();
Device->SetStreamSource(0, VB, 0, sizeof(Vertex));
Device->SetFVF(FVF_VERTEX);
Device->DrawPrimitive(D3DPT_TRIANGLELIST, 0, 3);