diff --git a/src/gl/stereo3d/gl_quadstereo.cpp b/src/gl/stereo3d/gl_quadstereo.cpp index b65c109c8d..769f289069 100644 --- a/src/gl/stereo3d/gl_quadstereo.cpp +++ b/src/gl/stereo3d/gl_quadstereo.cpp @@ -50,19 +50,19 @@ void QuadStereo::checkInitialRenderContextState() { // Keep trying until we see at least one good OpenGL context to render to static bool bDecentContextWasFound = false; - if (!bDecentContextWasFound) { - // I'm using a "random" OpenGL call (glGetFramebufferAttachmentParameteriv) - // that appears to correlate with whether the context is ready - GLint attachmentType = GL_NONE; - glGetFramebufferAttachmentParameteriv(GL_DRAW_FRAMEBUFFER, GL_FRONT_LEFT, GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE, &attachmentType); - if (attachmentType != GL_NONE) // Finally, a useful OpenGL context + static int contextCheckCount = 0; + if ( (! bDecentContextWasFound) && (contextCheckCount < 200) ) + { + contextCheckCount += 1; + glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0); // This question is about the main screen display 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 bDecentContextWasFound = true; // now we can stop checking every frame... // Now check whether this context supports hardware stereo - GLboolean supportsStereo, supportsBuffered; glGetBooleanv(GL_STEREO, &supportsStereo); - glGetBooleanv(GL_DOUBLEBUFFER, &supportsBuffered); bQuadStereoSupported = supportsStereo && supportsBuffered; leftEye.bQuadStereoSupported = bQuadStereoSupported; rightEye.bQuadStereoSupported = bQuadStereoSupported; diff --git a/wadsrc/static/language.enu b/wadsrc/static/language.enu index 06af663074..b05981a5a3 100644 --- a/wadsrc/static/language.enu +++ b/wadsrc/static/language.enu @@ -2725,7 +2725,7 @@ GLPREFMNU_AMBLIGHT = "Ambient light level"; GLPREFMNU_RENDERQUALITY = "Rendering quality"; GLPREFMNU_MENUBLUR = "Menu Blur"; GLPREFMNU_VRMODE = "Stereo 3D VR"; -GLPREFMNU_VRQUADSTEREO = "Enable Quad Stereo"; +GLPREFMNU_VRQUADSTEREO = "Enable Quad Stereo (Requires Restart)"; GLPREFMNU_MULTISAMPLE = "Multisample"; GLPREFMNU_TONEMAP = "Tonemap Mode"; GLPREFMNU_BLOOM = "Bloom effect";