Q:

Create stereo context for modern opengl

I am trying to create opengl (4.4) context with wglCreateContextAttribsARB.
Where do I specify it to be stereoscopic?
Or do I only specify it in window creation? If so, where? Is it PFD_STEREO?
Thanks.

A:

Stereoscopy support is part of the window's pixel format and not the OpenGL rendering context (although when a OpenGL RC is created it takes on the pixel format of the HDC it's created with). Set the pixel format as usual. You can use the pixel format selection function that's been available for 20 years, or use the slightly more modern Use wglChoosePixelFormatARB which has the WGL_STEREO_ARB attribute for the same effect (actually ChoosePixelFormatARB is modelled after the function of same name and functionality in GLX, which always was that way).

