Skip to content
Newer
Older
100644 54 lines (38 sloc) 918 Bytes
b89b276 @prsolucoes sistema funcional com threads, porem renderizando com erro
authored
1 #ifndef ENGINE_H
2 #define ENGINE_H
3
4 #include "Character.h"
5 #include "JSCharacter.h"
6 #include "Util.h"
7
8 #if __APPLE__
9 #include "ResourcePath.hpp"
10 #else
11 std::string resourcePath(void) { return ""; }
12 #endif
13
14 class Engine
15 {
16
17 public:
18 Engine();
19 ~Engine();
20
21 void start();
22 void run();
23 void runInThread();
94e3a60 @prsolucoes versao funcional com threads, porem graficos ainda nao acertados
authored
24 static void loadScript(Engine *engine);
b89b276 @prsolucoes sistema funcional com threads, porem renderizando com erro
authored
25
26 private:
27 Character *robot1;
28 Character *robot2;
29
94e3a60 @prsolucoes versao funcional com threads, porem graficos ainda nao acertados
authored
30 v8::Handle<v8::Object> jsPlayer1;
31 v8::Handle<v8::Object> jsPlayer2;
b89b276 @prsolucoes sistema funcional com threads, porem renderizando com erro
authored
32
33 v8::HandleScope handleScope;
34 v8::Persistent<v8::Context> context;
35 v8::Context::Scope *scope;
36
94e3a60 @prsolucoes versao funcional com threads, porem graficos ainda nao acertados
authored
37 sf::Mutex mutex;
38
b89b276 @prsolucoes sistema funcional com threads, porem renderizando com erro
authored
39 bool useThread;
40
41 sf::RenderWindow *window;
42
43 static v8::Handle<v8::String> readFile(const std::string& name);
44
45 void initializeGraphics();
46 void checkEvents();
47 void initializePlayers();
48 void initializeV8();
49 void initializeV8Binding();
50
51 };
52
53 #endif // ENGINE_H
Something went wrong with that request. Please try again.