ISF15ACP4 Driver 1.0.0
API reference
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
isf15acp4::Animator Class Reference

Drives timed frame updates on top of a GraphicsContext. More...

#include <isf15acp4_animator.hpp>

Collaboration diagram for isf15acp4::Animator:
[legend]

Public Member Functions

 Animator (GraphicsContext &gfx, AnimationFrameFn fn, void *user_data=nullptr, uint32_t fps=30) noexcept
 
bool Tick (uint32_t elapsed_ms) noexcept
 Advance animation clock and invoke frame callback when due.
 
void RenderNow () noexcept
 Force immediate frame render.
 
void SetFps (uint32_t fps) noexcept
 
void Reset () noexcept
 
uint32_t Frame () const noexcept
 

Private Attributes

GraphicsContext & gfx_
 
AnimationFrameFn frame_fn_
 
void * user_data_
 
uint32_t frame_ {0}
 
uint32_t frame_ms_ {33}
 
uint32_t elapsed_accum_ {0}
 

Detailed Description

Drives timed frame updates on top of a GraphicsContext.

Constructor & Destructor Documentation

◆ Animator()

isf15acp4::Animator::Animator ( GraphicsContext &  gfx,
AnimationFrameFn  fn,
void *  user_data = nullptr,
uint32_t  fps = 30 
)
inlinenoexcept

Member Function Documentation

◆ Frame()

uint32_t isf15acp4::Animator::Frame ( ) const
inlinenoexcept

◆ RenderNow()

void isf15acp4::Animator::RenderNow ( )
inlinenoexcept

Force immediate frame render.

◆ Reset()

void isf15acp4::Animator::Reset ( )
inlinenoexcept

◆ SetFps()

void isf15acp4::Animator::SetFps ( uint32_t  fps)
inlinenoexcept

◆ Tick()

bool isf15acp4::Animator::Tick ( uint32_t  elapsed_ms)
inlinenoexcept

Advance animation clock and invoke frame callback when due.

Member Data Documentation

◆ elapsed_accum_

uint32_t isf15acp4::Animator::elapsed_accum_ {0}
private

◆ frame_

uint32_t isf15acp4::Animator::frame_ {0}
private

◆ frame_fn_

AnimationFrameFn isf15acp4::Animator::frame_fn_
private

◆ frame_ms_

uint32_t isf15acp4::Animator::frame_ms_ {33}
private

◆ gfx_

GraphicsContext& isf15acp4::Animator::gfx_
private

◆ user_data_

void* isf15acp4::Animator::user_data_
private

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