function that creates index or vertex buffer problem

Started by
0 comments, last by lomateron 11 years, 5 months ago
i have something like this:

[source lang="java"]void createBuferfunction(...some other parameters...,DWORD array[])
{
...some other code...

D3D10_SUBRESOURCE_DATA iD;
iD.pSysMem = array; //here is the problem
hr = g_pd3dDevice->CreateBuffer( &bd, &iD, &Buffer);
}[/source]

but as you can see that doesnt work because the array will be read as having only 1 element.
Is there any other easy way to do this?
Advertisement
o i solved it i just had to add this line

iD.SysMemPitch=sizeof( DWORD )*numElementsofArray;

This topic is closed to new replies.

Advertisement