Nebula
Loading...
Searching...
No Matches
framesynctimer.h
Go to the documentation of this file.
1#pragma once
2//------------------------------------------------------------------------------
24#include "core/refcounted.h"
25#include "core/singleton.h"
26#include "timing/time.h"
27#include "timing/timer.h"
28
29//------------------------------------------------------------------------------
30namespace FrameSync
31{
98
99//------------------------------------------------------------------------------
102inline bool
104{
105 return this->isValid;
106}
107
108//------------------------------------------------------------------------------
111inline Timing::Time
113{
114 return this->time;
115}
116
117//------------------------------------------------------------------------------
120inline Timing::Tick
122{
123 return this->ticks;
124}
125
126//------------------------------------------------------------------------------
129inline Timing::Time
131{
132 return this->frameTime;
133}
134
135//------------------------------------------------------------------------------
138inline Timing::Tick
140{
141 return this->frameTicks;
142}
143
144//------------------------------------------------------------------------------
147inline void
149{
150 this->timeFactor = factor;
151}
152
153//------------------------------------------------------------------------------
156inline Timing::Time
158{
159 return this->timeFactor;
160}
161
162//------------------------------------------------------------------------------
165inline Timing::Time
167{
168 return this->scaledTime;
169}
170
171} // namespace FrameSync
172//------------------------------------------------------------------------------
173
174
The common base class of Nebula.
Definition refcounted.h:38
A thread-local time source object which is synchronized with the sync point in the FrameSyncHandlerTh...
Definition framesynctimer.h:33
Timing::Time timeFactor
Definition framesynctimer.h:92
virtual ~FrameSyncTimer()
destructor
Definition framesynctimer.cc:36
Timing::Tick frameTicks
Definition framesynctimer.h:90
IndexT frameIndex
Definition framesynctimer.h:95
Timing::Time GetTime() const
get current time
Definition framesynctimer.h:112
Timing::Time time
Definition framesynctimer.h:87
friend class FrameSyncHandlerThread
Definition framesynctimer.h:81
void Setup()
setup the object
Definition framesynctimer.cc:52
Timing::Time realTime
Definition framesynctimer.h:93
__DeclareClass(FrameSyncTimer)
__DeclareSingleton(FrameSyncTimer)
Timing::Tick GetTicks() const
get current time in ticks
Definition framesynctimer.h:121
Timing::Time scaledTime
Definition framesynctimer.h:91
Timing::Timer masterTimer
Definition framesynctimer.h:94
bool IsTimeRunning() const
return true if master time is running (DON'T CALL FREQUENTLY!)
Definition framesynctimer.cc:123
IndexT GetFrameIndex() const
get current frame count
Definition framesynctimer.cc:170
void Discard()
discard the object
Definition framesynctimer.cc:72
Timing::Tick ticks
Definition framesynctimer.h:88
void UpdateTimePolling()
update the time through polling, only necessary for threads other then render/game thread!
Definition framesynctimer.cc:87
void StopTime()
stop the master time (DON'T CALL FREQUENTLY!)
Definition framesynctimer.cc:105
Timing::Time frameTime
Definition framesynctimer.h:89
bool IsValid() const
return true if object is valid
Definition framesynctimer.h:103
void Update(Timing::Time masterTime)
update the time (always called from local thread)
Definition framesynctimer.cc:136
Timing::Time GetScaledTime() const
get scaled time
Definition framesynctimer.h:166
Timing::Time GetTimeFactor() const
get time factor
Definition framesynctimer.h:157
bool isValid
Definition framesynctimer.h:96
void ResetTime()
reset the master time (DON'T CALL FREQUENTLY!)
Definition framesynctimer.cc:114
Timing::Tick GetFrameTicks() const
get current frame time ins ticks
Definition framesynctimer.h:139
FrameSyncTimer()
constructor
Definition framesynctimer.cc:19
void SetTimeFactor(Timing::Time factor)
set time factor
Definition framesynctimer.h:148
Timing::Time GetScaledFrameTime() const
get scaled time
Definition framesynctimer.cc:161
Timing::Time GetFrameTime() const
get current frame time
Definition framesynctimer.h:130
void StartTime()
start the master time (DON'T CALL FREQUENTLY!)
Definition framesynctimer.cc:96
A timer object is the most basic object for time measurement.
Definition framesynctimer.cc:10
int Tick
the tick datatype (one tick == 1 millisecond)
Definition time.h:20
double Time
the time datatype
Definition time.h:18
Typedefs for the Timing subsystem.
int IndexT
Definition types.h:48