The following segment is from lesson 1, in the method
GLvoid KillGLWindow(GLvoid)
if (hRC) // Do We Have A Rendering Context?
{
if (!wglMakeCurrent(NULL,NULL)) // Are We Able To Release The DC And RC Contexts?
{
MessageBox(NULL,"Release Of DC And RC Failed.","SHUTDOWN ERROR",MB_OK | MB_ICONINFORMATION);
}
if (!wglDeleteContext(hRC)) // Are We Able To Delete The RC?
{
MessageBox(NULL,"Release Rendering Context Failed.","SHUTDOWN ERROR",MB_OK | MB_ICONINFORMATION);
}
hRC=NULL; // Set RC To NULL
}
I wanted to know why you try to release hRC and then try to delete hRC
and then set it to NULL anyways in that final statment. Like whether
you can or can't release/delete hRC it's still set to null so why are these
checks done at all? Can't you simply jst get rid of that check code and jst
have hRC = NULL? By gettin rid of the check code i mean simply have
if(hRC) {
hRC = NULL;
}
I've jst started learning this stuff so i'm pretty noob
at how this all works.
Thanx.