blob: 7159e0ce839ac5efe6345d8481b0f41740b4ed15 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
#ifndef PKE_GAME_HPP
#define PKE_GAME_HPP
#include <chrono>
#include <cstdint>
#include "event.hpp"
#include "imgui.h"
#include "ecs.hpp"
using GameTimeDuration = std::chrono::duration<int64_t, std::nano>;
using GameTimePoint = std::chrono::steady_clock::time_point;
#define NANO_DENOM std::chrono::nanoseconds::period::den
#define NANO_DENOM_DOUBLE double(std::chrono::nanoseconds::period::den)
struct GameSettings {
bool isGameRunning = true;
bool isGamePaused = false;
bool isFramerateUnlocked = true;
bool isShowingEditor = true;
int64_t targetFPS = 144;
int64_t minFPS = 20;
double deltaPerFrame = 1 / double(targetFPS);
double minimumDeltaPerFrame = 1 / double(minFPS);
};
extern GameSettings pkeSettings;
void GameInit();
void GameTick(double delta);
#endif /* PKE_GAME_HPP */
|