-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
37 lines (35 loc) · 801 Bytes
/
main.cpp
File metadata and controls
37 lines (35 loc) · 801 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
#include <iostream>
#include <thread>
#include <mutex>
#include <atomic>
#ifdef __linux__
#include <unistd.h>
#elif _WIN32
#include <windows.h>
#endif
#include "game.hpp"
#include "luapi.hpp"
std::mutex mtx;
//int State = NOTHING, Waiting = 0;
bool LuaRun = false;
bool Terminate = false;
Settings_t settings;
Event_t event;
//std::string Message = "";
//std::vector<std::string> opts;
//int choice;
//std::string imgpath;
int main(int argc, char* argv[])
{
std::cout << "====Starting LuaThread====" << std::endl;
std::thread lua_thread(LuaServer);
std::cout << "====Starting GameThread===" << std::endl;
GameProcess(argc > 1);
mtx.lock();
Terminate = true;
LuaRun = true;
mtx.unlock();
lua_thread.join();
std::cout << "C'est la fin les amis" << std::endl;
return 0;
}