wglCreateContext handle still valid?

Having created an opengl context, is there anyway to test a context handle and see if it is still valid? I need to store the handles elsewhere, and want to check at a later time whether a particular gl context is still valid or not. (i.e. if the related window has been closed)

The context is always valid till it is destroyed by a call to wglDeleteContext. It does not depend on a window or anything similar. Of course, you shouldn’t delete a DC if a context is made current to it, but this is a programmer mistake and can result in undefined behaviour. If you want to know if a window was closed, use the apropriate window system API.

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.