Do I need to "unload" the functions loaded by GL Load?

Hello, I’ve been tinkering about with GL Load and I’m wondering if I need to “unload” the functions if I want to make another call to LoadFunctions().

And also, does glload::GetMajorVersion() and glload::GetMinorVersion() return the version of the context or the version supported by the hardware?

HWND GLApp::CreateContext(LPCWSTR szWindowName)
{
	WNDCLASSEX wc = {0};
	wc.cbSize = sizeof(WNDCLASSEX);
	wc.style = CS_OWNDC;
	wc.hInstance = GetModuleHandle(NULL);
	wc.lpfnWndProc = &(Jiggine::WindowProc);
	wc.lpszClassName = L"GLAPP";

	RegisterClassEx(&wc);

	HWND hWnd = CreateWindowEx(
		NULL,L"GLAPP",
		L"GL App",
		WS_BORDER | WS_SYSMENU | WS_CAPTION,
		CW_USEDEFAULT,CW_USEDEFAULT,
		800,600,
		NULL,NULL,wc.hInstance,NULL);

	HDC hDC = GetDC(hWnd);

	int iPixelFormat = ChoosePixelFormat(hDC,&::gc_pfd);
	SetPixelFormat(hDC,iPixelFormat,&::gc_pfd);

	HGLRC hDummy = wglCreateContext(hDC);
	wglMakeCurrent(hDC,hDummy);

        glload::LoadFunctions(); // This is the first call to LoadFunctions(), to determine what version we're working with.

        int minVer = glload::GetMinorVersion(); //First problem here, will this return the version of the context(hDummy) or what's supported on the machine? I'm guessing the former which makes the following code stupid.
	int majVer = glload::GetMajorVersion();

	if(majVer < 3 && minVer < 1)
	{
		this->context = new GL2_1Context(hDummy);
		return hWnd;
	}

        //If glload::GetMajorVersion and glload::GetMinorVersion return what I want then we should end up here if there's something greater or equal to 3.1

	PFNWGLCREATECONTEXTATTRIBSARBPROC wglCreateContextAttribsARB = (PFNWGLCREATECONTEXTATTRIBSARBPROC)wglGetProcAddress("wglCreateContextAttribsARB");

	HGLRC hTheRealDeal = wglCreateContextAttribsARB(hDC,0,::gc_attribs);

	wglMakeCurrent(NULL,NULL);
	wglDeleteContext(hDummy);

	wglMakeCurrent(hDC,hTheRealDeal);

        glload::LoadFunctions(); //Will this load the functions valid for the new context?
        glload::LoadWinFunctions();

	this->context = new GL3_1Context(hTheRealDeal);

	return hWnd;
}

Any help is appreciated!

I’m wondering if I need to “unload” the functions if I want to make another call to LoadFunctions().

No. No memory is allocated by the loading process, so nothing needs to be undone.

And also, does glload::GetMajorVersion() and glload::GetMinorVersion() return the version of the context or the version supported by the hardware?

The context. There is no way to ask the hardware itself what it supports.

[QUOTE=Alfonse Reinheart;1243207]No. No memory is allocated by the loading process, so nothing needs to be undone.

The context. There is no way to ask the hardware itself what it supports.[/QUOTE]

So, this is not a viable way to check what version of OpenGL is available I take it?

So, this is not a viable way to check what version of OpenGL is available I take it?

It’s how you check what version of OpenGL you got. What “is available” means is irrelevant; it’s about what you got when you created your context.

And therefore what core functions you can expect to exist after you load them.