Jump to content
  • Advertisement
Sign in to follow this  
ArgusMaker

[DX9] ID3DXMesh::LockAttributeBuffer

This topic is 2563 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hey there!
Could you please give me some explanations about this method?
HRESULT LockAttributeBuffer( [in] DWORD Flags, [out] DWORD **ppData);This should fill an array of DWORD values, but I don't know what do these integers stand for..

Share this post


Link to post
Share on other sites
Advertisement
it's exatly the page where i took the colored definition of the function in my code tag.
It only says, for the second parameter:
[color="#2A2A2A"]Address of a pointer to a buffer containing a DWORD for each face in the mesh.
Still i don't understand what is the use of that DWORD.


[color="#2a2a2a"]My aim is to obtain the attribute table of the mesh, but i'm starting to feel like i have to keep a trace of it in a secondary variable..

Share this post


Link to post
Share on other sites
To get the attribute table you could do:



DWORD attribTableSize;
pMesh->GetAttributeTable(NULL, &attribTableSize);

D3DXATTRIBUTERANGE* pAttribTable = new D3DXATTRIBUTERANGE[attribTableSize];
pMesh->GetAttributeTable(pAttribTable, &attribTableSize);

The first GetAttributeTable just gives you the size so you can create the buffer, then you call the function again so it fills the buffer.




EDIT: changed code to make it more understandable (removed a member variable without declaration to a declared local)

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!