Jump to content
  • Advertisement

Archived

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

billybob

D3DXGetFVFVertexSize and struct padding

This topic is 5724 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

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
Advertisement
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
nevermind, i was accidentally passing &Data to memcpy instead of Data, which was already a pointer, it worked.

[edited by - billybob on January 20, 2003 8:15:00 PM]

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

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

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!