Wizard Engine
2D cross-platform game engine built around SDL2
 
Loading...
Searching...
No Matches
wze::timer Class Referencefinal

Timer modul. More...

#include <timer.hpp>

Public Member Functions

 timer ()=delete
 Deleted explicit constructor.
 

Static Public Member Functions

static uint8_t frame_time ()
 Gets the target frame time in milliseconds.
 
static void set_frame_time (uint8_t frame_time)
 Sets the target frame time in milliseconds.
 
static float delta_time ()
 Gets the current delta time in milliseconds.
 
static void set_delta_time (float delta_time)
 Sets the current delta time in milliseconds.
 
static uint32_t current_time ()
 Gets the current game time in milliseconds.
 

Detailed Description

Timer modul.

Definition at line 37 of file timer.hpp.

Member Function Documentation

◆ frame_time()

uint8_t wze::timer::frame_time ( )
staticnodiscard

Gets the target frame time in milliseconds.

Returns
Target frame time in milliseconds.
See also
set_frame_time(uint8_t frame_time)

Definition at line 33 of file timer.cpp.

33 {
34 return _frame_time;
35}

◆ set_frame_time()

void wze::timer::set_frame_time ( uint8_t frame_time)
static

Sets the target frame time in milliseconds.

Parameters
frame_timeTarget frame time in milliseconds.
See also
frame_time()

Definition at line 37 of file timer.cpp.

37 {
38 _frame_time = frame_time;
39}
static uint8_t frame_time()
Gets the target frame time in milliseconds.
Definition timer.cpp:33

◆ delta_time()

float wze::timer::delta_time ( )
staticnodiscard

Gets the current delta time in milliseconds.

Returns
Current delta time in milliseconds.
See also
set_delta_time(float delta_time)

Definition at line 41 of file timer.cpp.

41 {
42 return _delta_time;
43}

◆ set_delta_time()

void wze::timer::set_delta_time ( float delta_time)
static

Sets the current delta time in milliseconds.

Parameters
delta_timeCurrent delta time in milliseconds.
See also
delta_time()

Definition at line 45 of file timer.cpp.

45 {
46 _delta_time = delta_time;
47}
static float delta_time()
Gets the current delta time in milliseconds.
Definition timer.cpp:41

◆ current_time()

uint32_t wze::timer::current_time ( )
staticnodiscard

Gets the current game time in milliseconds.

Returns
Current game time in milliseconds.

Definition at line 49 of file timer.cpp.

49 {
50 return SDL_GetTicks();
51}

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