Jump to content
  • Advertisement


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


How to (correctly) dispose of a d3d device using c#/dx9?

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

Hello I have this program running using c# and dx9. (managed dx9, that is). In this program i have two modes of operation, windowed and fullscreen. In windowed mode, everything is ok, and when i close the app and run it again, no problem occur. But when i run it in fullscreen mode and exit (with no problem reported), I can no longer create a new device, because the program will hang. It doesn''t matter if it is fullscreen or windowed mode in the second run attempt. As soon as the device is created the screen mode changes to the previous run screen mode and hangs. My xp os will eventually reboot with a BSOD reporting a problem with an infinite loop and my display adapter driver. Since i create my d3d device from an existing form, and then switch it to fullscreen, it must have something to do with the dispose methods and something i am not properly terminating. I have tried to find the "right way" to do it in the dx sdk samples, but alas, the d3dapp class is, IMHO, too complex to be used as a sample and the code is, at best, obscure in some locations. I am sure it must have something to do with me not releasing (disposing) something attached to the d3d device, but i thought the c# garbage collector would do most of this dirty work automagically. If someone has any idea regarding common pitfalls in this area, please, some help would be appreciatted. Thank you for your time, Joao Correia

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.

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!