Does it matter when you release the DC
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.
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
-fel
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,
Just thought I'd clear that up for people like me :)
Sorry for going off topic,
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement