-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathckLua.h
More file actions
62 lines (44 loc) · 964 Bytes
/
Copy pathckLua.h
File metadata and controls
62 lines (44 loc) · 964 Bytes
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
57
58
59
60
61
62
#ifndef CKLUA_H
#define CKLUA_H
#include <string>
#include <ctime>
#include "InputListener.h"
#include "ckKey.h"
#include <unordered_map>
#include <setjmp.h>
extern "C" {
#include "lua.h"
#include "lualib.h"
#include "lauxlib.h"
}
class ckLua {
public:
ckLua();
~ckLua();
void run(bool lowLevelHook = false);
void changeScript(const std::string& fileName);
void changeKeyConfig(const std::string& fileName);
void keyDownCallback(int key, int flag);
void keyUpCallback(int key, int flag);
// Lua callbacks
int setLed(lua_State* L);
int setUPS(lua_State* L);
int setScript(lua_State* L);
int setKeymap(lua_State* L);
int luaPanic(lua_State* L);
void kill();
private:
bool beginFrame();
std::clock_t lastUpdateTime;
int targetFPS;
lua_State* L;
float deltaTime;
InputListener inputListener;
std::unordered_map<int, ckKey> keymap;
bool colorChange;
bool terminate;
bool luaError;
bool altgrdown;
bool altgrup;
};
#endif