Deki 1.3.0
Modular C++ 2D engine for embedded displays and desktop
Loading...
Searching...
No Matches
ITimeProvider Class Referenceabstract

Abstract interface for platform-specific time provider. More...

#include <ITimeProvider.h>

Public Member Functions

virtual ~ITimeProvider ()=default
virtual uint32_t GetTicksMs () const =0
 Get current time in milliseconds.
virtual void DelayMs (uint32_t ms) const
 Platform-specific delay (sleep) for the given number of milliseconds.

Detailed Description

Abstract interface for platform-specific time provider.

Platforms implement this to provide millisecond-resolution timing. Implementations:

  • SDL3: SDL_GetTicks()
  • ESP32: esp_timer_get_time() / 1000

Constructor & Destructor Documentation

◆ ~ITimeProvider()

virtual ITimeProvider::~ITimeProvider ( )
virtualdefault

Member Function Documentation

◆ GetTicksMs()

virtual uint32_t ITimeProvider::GetTicksMs ( ) const
pure virtual

Get current time in milliseconds.

Returns
Monotonic time in milliseconds (platform-specific epoch)

◆ DelayMs()

virtual void ITimeProvider::DelayMs ( uint32_t ms) const
inlinevirtual

Platform-specific delay (sleep) for the given number of milliseconds.

Used for frame rate limiting. Default is a no-op (busy wait falls through). Implementations:

  • SDL3: SDL_Delay()
  • ESP32: vTaskDelay(pdMS_TO_TICKS())

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