user4081361
user4081361

Reputation:

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.

Upvotes: 1

Views: 334

Answers (1)

datenwolf
datenwolf

Reputation: 162164

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).

Upvotes: 3

Related Questions