mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-11-28 23:11:58 +00:00
Fix: Bind the default framebuffer before testing whether hardware stereo 3D is supported. This allows Nvidia 3D vision glasses to function correctly when gl_light_shadowmap is ON.
Doc: Add "requires restart" to "enable quad stereo" option menu label, to help folks trying to setup 3D.
This commit is contained in:
parent
1e7df5505e
commit
a3399c1af2
2 changed files with 9 additions and 9 deletions
|
@ -50,19 +50,19 @@ void QuadStereo::checkInitialRenderContextState()
|
||||||
{
|
{
|
||||||
// Keep trying until we see at least one good OpenGL context to render to
|
// Keep trying until we see at least one good OpenGL context to render to
|
||||||
static bool bDecentContextWasFound = false;
|
static bool bDecentContextWasFound = false;
|
||||||
if (!bDecentContextWasFound) {
|
static int contextCheckCount = 0;
|
||||||
// I'm using a "random" OpenGL call (glGetFramebufferAttachmentParameteriv)
|
if ( (! bDecentContextWasFound) && (contextCheckCount < 200) )
|
||||||
// that appears to correlate with whether the context is ready
|
{
|
||||||
GLint attachmentType = GL_NONE;
|
contextCheckCount += 1;
|
||||||
glGetFramebufferAttachmentParameteriv(GL_DRAW_FRAMEBUFFER, GL_FRONT_LEFT, GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE, &attachmentType);
|
glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0); // This question is about the main screen display context
|
||||||
if (attachmentType != GL_NONE) // Finally, a useful OpenGL context
|
GLboolean supportsStereo, supportsBuffered;
|
||||||
|
glGetBooleanv(GL_DOUBLEBUFFER, &supportsBuffered);
|
||||||
|
if (supportsBuffered) // Finally, a useful OpenGL context
|
||||||
{
|
{
|
||||||
// This block will be executed exactly ONCE during a game run
|
// This block will be executed exactly ONCE during a game run
|
||||||
bDecentContextWasFound = true; // now we can stop checking every frame...
|
bDecentContextWasFound = true; // now we can stop checking every frame...
|
||||||
// Now check whether this context supports hardware stereo
|
// Now check whether this context supports hardware stereo
|
||||||
GLboolean supportsStereo, supportsBuffered;
|
|
||||||
glGetBooleanv(GL_STEREO, &supportsStereo);
|
glGetBooleanv(GL_STEREO, &supportsStereo);
|
||||||
glGetBooleanv(GL_DOUBLEBUFFER, &supportsBuffered);
|
|
||||||
bQuadStereoSupported = supportsStereo && supportsBuffered;
|
bQuadStereoSupported = supportsStereo && supportsBuffered;
|
||||||
leftEye.bQuadStereoSupported = bQuadStereoSupported;
|
leftEye.bQuadStereoSupported = bQuadStereoSupported;
|
||||||
rightEye.bQuadStereoSupported = bQuadStereoSupported;
|
rightEye.bQuadStereoSupported = bQuadStereoSupported;
|
||||||
|
|
|
@ -2725,7 +2725,7 @@ GLPREFMNU_AMBLIGHT = "Ambient light level";
|
||||||
GLPREFMNU_RENDERQUALITY = "Rendering quality";
|
GLPREFMNU_RENDERQUALITY = "Rendering quality";
|
||||||
GLPREFMNU_MENUBLUR = "Menu Blur";
|
GLPREFMNU_MENUBLUR = "Menu Blur";
|
||||||
GLPREFMNU_VRMODE = "Stereo 3D VR";
|
GLPREFMNU_VRMODE = "Stereo 3D VR";
|
||||||
GLPREFMNU_VRQUADSTEREO = "Enable Quad Stereo";
|
GLPREFMNU_VRQUADSTEREO = "Enable Quad Stereo (Requires Restart)";
|
||||||
GLPREFMNU_MULTISAMPLE = "Multisample";
|
GLPREFMNU_MULTISAMPLE = "Multisample";
|
||||||
GLPREFMNU_TONEMAP = "Tonemap Mode";
|
GLPREFMNU_TONEMAP = "Tonemap Mode";
|
||||||
GLPREFMNU_BLOOM = "Bloom effect";
|
GLPREFMNU_BLOOM = "Bloom effect";
|
||||||
|
|
Loading…
Reference in a new issue