Sign in to follow this  

Modifying contents in the Vertex Buffer

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

This topic is 4716 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this