Begin refactor.
This commit is contained in:
@ -6,7 +6,40 @@
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
#include <dawn/dawn.h>
|
||||
#include "../libs.h"
|
||||
|
||||
#define EPOCH_FIXED_STEP 0.016f
|
||||
#define EPOCH_SMALLEST_STEP 0.001f
|
||||
|
||||
typedef struct {
|
||||
/**
|
||||
* Current time (as a float of seconds since game start).
|
||||
*
|
||||
* When time is initialized this will start at a fixed value of 2/60ths of a
|
||||
* second, regardless of what engine the game is running.
|
||||
*
|
||||
* This is to avoid any divide by zero errors.
|
||||
*/
|
||||
float current;
|
||||
|
||||
/**
|
||||
* Last Time (as a float of seconds since the game start).
|
||||
*
|
||||
* This value will start at 1/60th of a second regardless of engine the game
|
||||
* is running on to avoid divide by zero errors.
|
||||
*/
|
||||
float last;
|
||||
|
||||
/**
|
||||
* Varying timestep that occured since the last frame.
|
||||
*/
|
||||
float delta;
|
||||
|
||||
/**
|
||||
* Fixed timestep that is not affected by framerate but remains consistent.
|
||||
*/
|
||||
float fixedDelta;
|
||||
} epoch_t;
|
||||
|
||||
/**
|
||||
* Initializes the epoch time tracking.
|
||||
|
Reference in New Issue
Block a user