From 23ac972d4e2f7fe6971d7fbab3d502bbfd9f4651 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Fri, 5 Jan 2007 13:01:08 +0000 Subject: [PATCH] Added a workaround for computing the time of an event. --- include/osgViewer/GraphicsWindowX11 | 5 ++- src/osgViewer/GraphicsWindowX11.cpp | 57 +++++++++++++++++++++-------- 2 files changed, 45 insertions(+), 17 deletions(-) diff --git a/include/osgViewer/GraphicsWindowX11 b/include/osgViewer/GraphicsWindowX11 index 4f3eaa45e..f21318ff3 100644 --- a/include/osgViewer/GraphicsWindowX11 +++ b/include/osgViewer/GraphicsWindowX11 @@ -44,7 +44,8 @@ class GraphicsWindowX11 : public osgViewer::GraphicsWindow _nullCursor(0), _currentCursor(0), _initialized(false), - _realized(false) + _realized(false), + _timeOfLastCheckEvents(-1.0) { _traits = traits; @@ -129,6 +130,8 @@ class GraphicsWindowX11 : public osgViewer::GraphicsWindow bool _initialized; bool _realized; + + double _timeOfLastCheckEvents; }; } diff --git a/src/osgViewer/GraphicsWindowX11.cpp b/src/osgViewer/GraphicsWindowX11.cpp index ecf7dcc44..9cbcd7c51 100644 --- a/src/osgViewer/GraphicsWindowX11.cpp +++ b/src/osgViewer/GraphicsWindowX11.cpp @@ -612,12 +612,19 @@ void GraphicsWindowX11::checkEvents() { if (!_realized) return; + double baseTime = _timeOfLastCheckEvents; + double eventTime = baseTime; + double resizeTime = eventTime; + _timeOfLastCheckEvents = getEventQueue()->getTime(); + int windowX = _traits->x; int windowY = _traits->y; int windowWidth = _traits->width; int windowHeight = _traits->height; bool destroyWindowRequested = false; + + Time firstEventTime = 0; // osg::notify(osg::NOTICE)<<"Check events"<