Jump to content
  • Advertisement
Sign in to follow this  
smally

Struggling with dynamic geometry

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

Ok, quick question, I'm struggling learning to do dynamic geometry in D3D9, and the Direct3d book I'm learning from, only talks about it for for one page, with no code. Is there anywhere online that can help me with using dynamic geometry? (google has failed me) I'm just trying to do a simple ocean waves scene, but everytime is use D3DUSAGE_WRITEONLY | D3DUSAGE_DYNAMIC and D3DLOCK_DISCARD my program crashes. Thanks in advance.

Share this post


Link to post
Share on other sites
Advertisement
Have you googled for tutorials.

Regarding the crash, flip D3D into Debug mode and it should spew out some error messages.

Share this post


Link to post
Share on other sites
Quote:
Original post by smally
I'm just trying to do a simple ocean waves scene, but everytime is use D3DUSAGE_WRITEONLY | D3DUSAGE_DYNAMIC and D3DLOCK_DISCARD my program crashes.
That means you're not responding to D3D errors correctly. Every D3D function that returns information you rely on MUST have its return value checked. For instance, CreateVertexBuffer() returns a pointer. If you ignore the return value from it and assume it succeeded, then when it fails you have a broken pointer. Which you then dereference and the whole program blows up.

You should also always be using the Debug Runtimes.

As for the actual problem, we'll need to see some code, and what you mean by "crash" (I.e. the exact runtime error you get [Like "Access Violation reading 0x0000004"]), and the line of code causing it.

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!