How do I switch the monitor out of 3d mode under OpenGL?
Under Windows 8 with the 13.6 beta Catalyst drivers I am getting into 3d stereoscopic mode (even in a window) fine.
Under wxWidgets I'm setting
WX_GL_STEREO in the glattributes.
However when I exit the monitor (AOC 27 inch) is being left in stereoscopic mode.
Should the monitor automatically switch back when the wglDeleteContext is called? When the window is closed?
I have to run the Tri-def MediaPlayer and then exit to get the screen out of 3d stereoscopic mode.
The behavior you're seeing is by design and is a part of Windows 8. It is not specific to OpenGL or the AMD driver.
For instance, even if you run a D3D 11.1 stereo application that destroys its stereo swapchain on exit, DWM will remain in stereo mode. I see another (unanswered) question similar to this was posted to the MSDN forum: "Using Direct3D stereoscopic 3D sample, my display stays in 3D mode."
When running TriDef Media Viewer, I believe it is using D3D9 and the AMD stereo extension-- that is, a fullscreen stereo mode that pre-dates Windows 8 and WDDM 1.2. (Note, for example, that if you switch out of fullscreen mode in TriDef Media Viewer, it drops out of stereo mode.) It is not using DX11.1 or OpenGL, so that is why it behaves differently than your application.
There is a workaround you can use to force DWM to stop displaying in stereo mode, but this goes against the intended Windows 8 behavior and I would not recommend it for a production app: After destroying the OpenGL context, call the Win32 API function ChangeDisplaySettings(), specifying a valid, nonstereo refresh rate. You might also need to specify the width and height bitflags, even though you wouldn't actually change the resolution, otherwise ChangeDisplaySettings() might be ignored. When the display mode change occurs, DWM will stop displaying in stereo mode.
Here's the reason for the Windows 8 behavior: if a mode change occurred every time a stereo app exited, then the user experience would be rather poor in situations where a stereo app was being run and closed frequently, because it takes the typical monitor a second or two to switch modes.
OpenGL Driver Team, AMD
The information presented in this document
is for informational purposes only and may contain technical inaccuracies,
omissions and typographical errors. Links to third party sites are for
convenience only, and no endorsement is implied.