mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-11-25 05:31:00 +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
|
||||
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;
|
||||
|
|
|
@ -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";
|
||||
|
|
Loading…
Reference in a new issue