Skip to content

Commit 7a4950f

Browse files
committed
Moved _frameStamp initialization in constructor
1 parent 871e7d3 commit 7a4950f

2 files changed

Lines changed: 8 additions & 4 deletions

File tree

include/vsg/app/Viewer.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,11 +153,13 @@ namespace vsg
153153

154154
bool _close = false;
155155

156-
ref_ptr<FrameStamp> _frameStamp;
157156

158157
Windows _windows;
159158

159+
bool _firstFrame = true;
160160
clock::time_point _start_point;
161+
ref_ptr<FrameStamp> _frameStamp;
162+
161163
UIEvents _events;
162164
EventHandlers _eventHandlers;
163165

src/vsg/app/Viewer.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,9 @@ Viewer::Viewer() :
3131
updateOperations(UpdateOperations::create()),
3232
animationManager(AnimationManager::create()),
3333
status(vsg::ActivityStatus::create()),
34-
_start_point(clock::now())
34+
_firstFrame(true),
35+
_start_point(clock::now()),
36+
_frameStamp(FrameStamp::create(_start_point, 0, 0.0))
3537
{
3638
CPU_INSTRUMENTATION_L1_NC(instrumentation, "Viewer costructor", COLOR_VIEWER);
3739
}
@@ -169,9 +171,9 @@ bool Viewer::advanceToNextFrame(double simulationTime)
169171

170172
// create FrameStamp for frame
171173
auto time = vsg::clock::now();
172-
if (!_frameStamp)
174+
if (_firstFrame)
173175
{
174-
_start_point = time;
176+
_firstFrame = false;
175177

176178
if (simulationTime == UseTimeSinceStartPoint) simulationTime = 0.0;
177179

0 commit comments

Comments
 (0)