Jump to content
  • Advertisement
Sign in to follow this  
Toonkides

Modifying contents in the Vertex Buffer

This topic is 4962 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 was working on a Tile Editor which actually works fine, however when I minimize the application I noticed it would crash! I pinpointed the problem down to my startGeometry() function which basically unlocks the VB and modifies contents of it then locks it. I'm curious, if this is not the proper way of modifying the items in your VB then how should it be done ? tia

Share this post


Link to post
Share on other sites
Advertisement
When you run in a window you have to share the graphics card with other apps, when minimised you lose the device pointer and therefore have to obtain a new one when maximised.

Share this post


Link to post
Share on other sites
Just in case it's not a typo... you Lock, modify, then unlock. It's likely you're doing this as you say the app normally works.

Look into Lost Devices.

TestCooperativeLevel should tell you if the device is a) lost (minimized, system menu, or alt-tabbed out of a fullscreen app) and you should not render, b) not reset (device was lost, as is lost no more), and requires a Reset before you render, or c) ok. Go ahead and render.

When doing a Reset certain things must be destroyed before the reset and created again afterwards. Things like POOL_DEFAULT vertex buffers, index buffers, textures. Stateblocks need to be destroyed and created again. Shaders survive. POOL_MANAGED objects survive. More details can be found in the SDK.

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.

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!