Loading...
Searching...
No Matches
score::gfx::TimerClock Class Referencefinal

Wraps GfxContext's shared wall-timer (clock #2, the default). More...

Inheritance diagram for score::gfx::TimerClock:
score::gfx::RenderClock

Detailed Description

Wraps GfxContext's shared wall-timer (clock #2, the default).

One TimerClock == one HighResolutionTimer acquired from a score::Timers pool at a given frequency, shared (coalesced) among every output rendering at that rate — mirroring the old GfxContext::m_manualTimers entry. The per-output fan-out (render() for each output that canRender()) lives in the tick closure that GfxContext hands to start(), exactly as the old on_manual_timer did.

Public Member Functions

 TimerClock (score::Timers &timers, QObject *owner, double frequencyHz)
 
Kind kind () const noexcept override
 
double frequency () const noexcept
 
void addOutput (OutputNode *o)
 
void removeOutput (OutputNode *o)
 
bool empty () const noexcept
 
const std::vector< OutputNode * > & outputs () const noexcept
 
void start (std::function< void()> tick) override
 Begin delivering ticks.
 
void stop () override
 Stop delivering ticks and release the underlying tick source.
 

Additional Inherited Members

- Public Types inherited from score::gfx::RenderClock
enum class  Kind { Timer , DisplayVSync , ExternalGenlock }
 

Constructor & Destructor Documentation

◆ TimerClock()

score::gfx::TimerClock::TimerClock ( score::Timers timers,
QObject *  owner,
double  frequencyHz 
)
Parameters
timersthe (per-GfxContext) timer pool to acquire from
ownerQObject used as the queued-connection receiver context, so the tick runs on that object's thread (score's render thread) — identical to the old connect(timer, ..., this).
frequencyHzthe shared timer frequency (1000 / manualRenderingRate)

Member Function Documentation

◆ kind()

Kind score::gfx::TimerClock::kind ( ) const
inlineoverridevirtualnoexcept

◆ start()

void score::gfx::TimerClock::start ( std::function< void()>  tick)
overridevirtual

Begin delivering ticks.

tick is invoked once per render tick, on the render thread. The clock owns the tick source (timer, vsync registration, or hardware wait loop).

Implements score::gfx::RenderClock.

◆ stop()

void score::gfx::TimerClock::stop ( )
overridevirtual

Stop delivering ticks and release the underlying tick source.

Implements score::gfx::RenderClock.


The documentation for this class was generated from the following files: