Skip to main content
GameDev.net gamedev.net
๐Ÿ”’ Locked

function that creates index or vertex buffer problem

Started by lomateron Nov 18, 2012 at 5:11 AM 0 replies 1k views
Original Post
lomateron
lomateron
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?
lomateron
lomateron
o i solved it i just had to add this line

iD.SysMemPitch=sizeof( DWORD )*numElementsofArray;

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.