Is it necessary to delete the HDC and HRC when using the win32 api for OpenGL? I would think the Win32API would destroy them upon the window's closing?
Clarification: The HRC is a HGLRC object.
Is it "necessary"? If your process terminates itself after closing the window, no. Windows will clean up outstanding handles of these type.
Should you do it? Absolutely. You should always clean up objects you use in your application. Dropping things on the floor for the OS to clean up is not good practice. If for no other reason than the fact that you might want to create a new window after closing the old one. In which case, you have this garbage HGLRC lying around taking up precious resources.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With