Jump to content
  • Advertisement

Archived

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

Striker2002

how to delete Offscreen DX Surfaces?

This topic is 6243 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 want to throw a directX Offscreen Surface out of my memory. Therefore I use this code: if(lpDDSOffscreen != NULL) { lpDDSOffscreen->Release(); lpDDSOffscreen=NULL; } But my program hangs up. What´s wrong?

Share this post


Link to post
Share on other sites
Advertisement
When do you release it... at the end of during the game.

If it is during the game u release memory for it then I am not sure if am right but I think it is attached to the primary surface which may cause it to hang. also if done so in mid game, your code may make reference to it and because the memory is no longer active may cause problems....But I am not sure

If u are releasing it at shut down time when the game ends, then the order u release it may be a problem, because (I think) it is attached to the primary surface u might be releasing the primary surface before the offscreen one. In this case try releasing it in reverse order of initialistion.

I dont know much about DirectX as I am still trying to get my brain to accept that it aint DOS no more, so I hope I was any help or gave u any ideas

Holla back


Dark Star
UK

Share this post


Link to post
Share on other sites
Yes I try to do it in the middle of the game, I need the Startpicture only one time. There has to be a way to get rid of it. If not I use this surface for something ohter, but its not the best way..

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!