How I'm creating my rendering context using wgl :
//Device
HDC hdc = GetDC(hWnd);
HGLRC hRC = wglCreateContext(hdc);
How/where/when should I change the version of the OpenGL context?
Is there a function like wglCreateContextVer(hdc, major(3) /major/, 0 /minor/, "core");
You can use wglCreateContextAttribsARB
. e.g.:
int attributes[] = {
WGL_CONTEXT_MAJOR_VERSION_ARB, 3,
WGL_CONTEXT_MINOR_VERSION_ARB, 3,
WGL_CONTEXT_PROFILE_MASK_ARB, WGL_CONTEXT_CORE_PROFILE_BIT_ARB,
WGL_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB, 1,
0,
};
HGLRC hRC = wglCreateContextAttribsARB(hdc, 0, attributes);