Jump to content
  • Advertisement
Sign in to follow this  
dustydoodoo

Does it matter when you release the DC

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

Well i found this tutorial on gametutorials and on the example he uses ReleaseDC() at the end of winmain, and then i did it and released the dc in winProc. Because i was wondering how it can still draw on the screen when the dc is released? all my drawing funcions are in winProc.

Share this post


Link to post
Share on other sites
Advertisement
ReleaseDC doesn't really kill the device context, it just releases the device context handle your program is using so the system can do what it wants with the device context, and kills the handle (though due to the fact that the memory is probably not overwritten you can probably use the handle anyway, though you shouldn't. Or you can GetDC it again). DeleteDC really kills device contexts and should never be used on a device context acquired via GetDC, though I think it will just return an error rather than crashing iirc.

-fel

Share this post


Link to post
Share on other sites
Well this is off topic but I had no idea what iirc was so I googled for all those who didn't know what it meant. It is an acronym for "if i read correctly"
Just thought I'd clear that up for people like me :)
Sorry for going off topic,

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!