Archived

This topic is now archived and is closed to further replies.

billybob

D3DXGetFVFVertexSize and struct padding

Recommended Posts

i''m having trouble wrapping vertex buffers, and i''m like 99.999% sure its because D3DXGetFVFVertexSize does not account for struct padding. the reason i''m 99.999% sure is because i''ve checked over everything about a trillion times, and can''t find anything wrong with it. if it doesn''t account for struct padding, how can i correct it?

Share this post


Link to post
Share on other sites
Look at the docs for:

#pragma pack

Which lets you change the packing alignment for structures - set it to 1 to pack to exact sizes.


Though bear in mind that if you wrap your vertex format in a structure or class, ANY other member variable will make the FVF invalid.


--
Simon O''Connor
Creative Asylum Ltd
www.creative-asylum.com

Share this post


Link to post
Share on other sites