so i have parsed all the data in the obj file and stored them in vectors
std::vector<DWORD> indices;
std::vector<D3DXVECTOR3> vertPos;
std::vector<D3DXVECTOR3> vertNorm;
std::vector<D3DXVECTOR2> vertTexCoord;
I am abit stuck creating the VertexBuffer from the vector and also the indexbuffer using these functions
d3ddev->CreateIndexBuffer()
d3ddev->CreateVertexBuffer()
i know most of what the params are, i just dont know how to store the actual data in to them from vectors
for loading your own custom cube for example you do
// create an index buffer interface called i_buffer
d3ddev->CreateIndexBuffer(36*sizeof(short),
0,
D3DFMT_INDEX16,
D3DPOOL_MANAGED,
&i_buffer,
NULL);
// lock i_buffer and load the indices into it
i_buffer->Lock(0, 0, (void**)&pVoid, 0);
memcpy(pVoid, indices, sizeof(indices));
i_buffer->Unlock();
// create a vertex buffer interface called v_buffer
d3ddev->CreateVertexBuffer(24*sizeof(CUSTOMVERTEX),
0,
CUSTOMFVF,
D3DPOOL_MANAGED,
&v_buffer,
NULL);
VOID* pVoid; // a void pointer
// lock v_buffer and load the vertices into it
v_buffer->Lock(0, 0, (void**)&pVoid, 0);
memcpy(pVoid, vertices, sizeof(vertices));
v_buffer->Unlock();
my attempt would be
thanks if you can help