From 27616ff6c15018b953375a9d60deb068bb2517f1 Mon Sep 17 00:00:00 2001
From: Rene Brun <Rene.Brun@cern.ch>
Date: Fri, 11 Dec 2009 08:09:40 +0000
Subject: [PATCH] =?UTF-8?q?From=20Bertrand:=20Fix=20compilation=20errors?=
 =?UTF-8?q?=20on=20Windows,=20due=20to=20the=20use=20of=20=E2=80=9Cnear?=
 =?UTF-8?q?=E2=80=9D=20and=20=E2=80=9Cfar=E2=80=9D=20variable=20names,=20b?=
 =?UTF-8?q?eing=20keywords=20on=20Windows.?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

git-svn-id: http://root.cern.ch/svn/root/trunk@31828 27541ba8-7e3a-0410-8455-c3a389f83636
---
 graf3d/gl/src/TGLViewer.cxx | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/graf3d/gl/src/TGLViewer.cxx b/graf3d/gl/src/TGLViewer.cxx
index 0b4ab513b9b..907c27f0a86 100644
--- a/graf3d/gl/src/TGLViewer.cxx
+++ b/graf3d/gl/src/TGLViewer.cxx
@@ -635,7 +635,7 @@ void TGLViewer::DoDrawStereo()
 
    TGLPerspectiveCamera &c = *dynamic_cast<TGLPerspectiveCamera*>(fCurrentCamera);
 
-   Float_t near, far, zero_p_dist;
+   Float_t gl_near, gl_far, zero_p_dist;
    Float_t h_half, w_half;
    Float_t x_len_at_zero_parallax;
    Float_t stereo_offset;
@@ -648,24 +648,24 @@ void TGLViewer::DoDrawStereo()
    PreDraw();
    PreRender();
 
-   near = c.GetNearClip();
-   far  = c.GetFarClip();
-   zero_p_dist = near + fStereoZeroParallax*(far-near);
+   gl_near = c.GetNearClip();
+   gl_far  = c.GetFarClip();
+   zero_p_dist = gl_near + fStereoZeroParallax*(gl_far-gl_near);
 
-   h_half = TMath::Tan(0.5*TMath::DegToRad()*c.GetFOV()) * near;
+   h_half = TMath::Tan(0.5*TMath::DegToRad()*c.GetFOV()) * gl_near;
    w_half = h_half * fViewport.Aspect();
 
-   x_len_at_zero_parallax = 2.0f * w_half * zero_p_dist / near;
+   x_len_at_zero_parallax = 2.0f * w_half * zero_p_dist / gl_near;
    stereo_offset = 0.035f * x_len_at_zero_parallax * fStereoEyeOffsetFac;
 
-   frustum_asym = stereo_offset * near / zero_p_dist * fStereoFrustumAsymFac;
+   frustum_asym = stereo_offset * gl_near / zero_p_dist * fStereoFrustumAsymFac;
 
    glTranslatef(-stereo_offset, 0, 0);
 
    glMatrixMode(GL_PROJECTION);
    glLoadIdentity();
    glFrustum(-w_half + frustum_asym, w_half + frustum_asym,
-             -h_half, h_half, near, far);
+             -h_half, h_half, gl_near, gl_far);
    glMatrixMode(GL_MODELVIEW);
 
    fRnrCtx->StartStopwatch();
@@ -703,7 +703,7 @@ void TGLViewer::DoDrawStereo()
    glMatrixMode(GL_PROJECTION);
    glLoadIdentity();
    glFrustum(-w_half - frustum_asym, w_half - frustum_asym,
-             -h_half, h_half, near, far);
+             -h_half, h_half, gl_near, gl_far);
    glMatrixMode(GL_MODELVIEW);
 
    fRnrCtx->StartStopwatch();
-- 
GitLab