(OpenGL) wglCreateContext () context version
2 answers
You need to use wglCreatContextAttribsARB (...)
from extension: WGL_ARB_create_context .
Something like this:
// Request an OpenGL 3.3 context
const GLuint attribs [] = { WGL_CONTEXT_MAJOR_VERSION_ARB, 3,
WGL_CONTEXT_MINOR_VERSION_ARB, 3,
0 };
HGLRC hRC = wglCreateContextAttribsARB (hDC, 0, attribs);
Ironically, this means creating an OpenGL context, loading that extension, destroying the original context, and creating a new one by calling wglCreateContextAttribsARB (...)
. See Extension Specification. I have listed for more details.
When this extension is supported, the call
wglCreateContext (hdc)
This is equivalent to calling
wglCreateContextAttribsARB (hdc, 0, NULL)
+4
source to share