-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.h
42 lines (33 loc) · 788 Bytes
/
App.h
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
33
34
35
36
37
38
39
40
41
42
#pragma once
#include <stdinc.h>
#include "Geom.h"
#include "Window.h"
using namespace std;
#ifndef FIXED_UPDATE_DELTA
#define FIXED_UPDATE_DELTA 16
#endif
#ifndef MAX_FPS
#define MAX_FPS 60
#endif
class App {
public:
unique_ptr<Window> window;
chrono::time_point<chrono::high_resolution_clock> startTime;
chrono::time_point<chrono::high_resolution_clock> lastFixedUpdate;
chrono::time_point<chrono::high_resolution_clock> lastDrawTick;
chrono::milliseconds fixedUpdateDelta;
chrono::milliseconds maxFps;
GLuint vertexBuffer;
App();
~App();
void init();
static void reloadShaders();
void createEntities();
void mainLoop();
void earlyUpdate();
void update();
void lateUpdate();
void fixedUpdate();
private:
vector<shared_ptr<Geom>> entities;
};