-
Notifications
You must be signed in to change notification settings - Fork 6
/
Engine.h
56 lines (48 loc) · 1.2 KB
/
Engine.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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#pragma once
#include "BlockingQueue.h"
#include "DbAlbumCollection.h"
#include "DbReloadWorker.h"
#include "FindAsYouType.h"
#include "GLContext.h"
#include "PlaybackTracer.h"
#include "Renderer.h"
#include "TextureCache.h"
#include "cover_positions.h"
#include "utils.h"
#include "world_state.h"
class HighTimerResolution {
public:
HighTimerResolution();
NO_MOVE_NO_COPY(HighTimerResolution);
~HighTimerResolution();
int get();
};
class Engine {
public:
EngineWindow& window;
class EngineThread& thread;
class StyleManager& styleManager;
GLContext glContext;
DbAlbumCollection db;
FindAsYouType findAsYouType;
ScriptedCoverPositions coverPos;
WorldState worldState;
TextureCache texCache;
FpsCounter fpsCounter;
Renderer renderer;
PlaybackTracer playbackTracer;
unique_ptr<DbReloadWorker> reloadWorker;
Engine(EngineThread&, EngineWindow&, StyleManager& styleManager);
void mainLoop();
void updateRefreshRate();
void setTarget(DBPos target, bool userInitiated);
private:
bool windowDirty = false;
bool cacheDirty = true;
int refreshRate = 60;
std::atomic<bool> shouldStop = false;
public:
struct Messages;
};
using EM = Engine::Messages;
#include "engine_messages.h"