From c518d69013dc23ae4f00dfee6f02d46123d75515 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Mon, 31 Dec 2001 23:21:16 +0000 Subject: [PATCH] Removed the variables which were duplicated in osgGLUT::Viewer and osgGLUT::Window, standardising on the Window ones, and therefore removing an unitialized variable that had been introduced. This caused a crash under WindowsXP due to send invalid values to glutReshapeWindow. --- include/osgGLUT/Viewer | 3 --- src/osgGLUT/Viewer.cpp | 8 ++++---- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/include/osgGLUT/Viewer b/include/osgGLUT/Viewer index 0b97b932f..3d73cfb0e 100644 --- a/include/osgGLUT/Viewer +++ b/include/osgGLUT/Viewer @@ -124,15 +124,12 @@ class OSGGLUT_EXPORT Viewer : public Window, osgUtil::GUIActionAdapter bool _viewFrustumCullingActive; bool _smallFeatureCullingActive; - int mx, my, mbutton; int polymode; int texture; int backface; int lighting; int flat_shade; int _two_sided_lighting; - bool fullscreen; - int _saved_wx, _saved_wy, _saved_ww,_saved_wh; float frRate; // gwm Jul 2001 added convolved ('averaged') frame rate int _printStats; // gwm Jul 2001 change from bool struct { // gwm Jul 2001, added for display of statistics diff --git a/src/osgGLUT/Viewer.cpp b/src/osgGLUT/Viewer.cpp index 68782f0c9..08d2e5df6 100644 --- a/src/osgGLUT/Viewer.cpp +++ b/src/osgGLUT/Viewer.cpp @@ -704,8 +704,8 @@ void Viewer::mouseMotion(int x, int y) // osg::notify(osg::INFO) << "Handled mouseMotion "<_buttonMask<<" x="<_mx<<" y="<_my<< std::endl; } - mx = x; - my = y; + _mx = x; + _my = y; } @@ -942,8 +942,8 @@ void Viewer::keyboard(unsigned char key, int x, int y) break; case 'f' : - fullscreen = !fullscreen; - if (fullscreen) + _fullscreen = !_fullscreen; + if (_fullscreen) { _saved_ww = _ww; _saved_wh = _wh;