source:
orxonox.OLD/orxonox/trunk/src/subprojects/framework.h
@
4588
Last change on this file since 4588 was 4554, checked in by bensch, 19 years ago | |
---|---|
File size: 1.3 KB |
Rev | Line | |
---|---|---|
[2931] | 1 | #ifndef _FRAMEWORK_H |
2 | #define _FRAMEWORK_H | |
[4554] | 3 | |
[3656] | 4 | #include "vector.h" |
[4293] | 5 | #include "glincl.h" |
[4334] | 6 | #include "SDL_events.h" |
[4343] | 7 | #include "debug.h" |
[2931] | 8 | |
[4343] | 9 | #ifdef GUI_MODULE |
[4333] | 10 | #include "gui_gtk.h" |
[4554] | 11 | #endif |
[4297] | 12 | |
[4546] | 13 | #define DATA_DIRECTORY "~/orxonox/repos/trunk/data/" |
[4306] | 14 | #define MOUSE_BUTTON_COUNT 8 |
[4295] | 15 | |
[4297] | 16 | class Camera; |
[2952] | 17 | |
[4297] | 18 | class Framework { |
19 | private: | |
[4317] | 20 | Framework(); |
21 | static Framework* singletonRef; | |
[4554] | 22 | |
[4297] | 23 | Camera* camera; |
[4554] | 24 | |
[4331] | 25 | bool isFinished; |
[4317] | 26 | |
[4300] | 27 | int movement [4]; |
[4374] | 28 | float backgroundColor[4]; |
29 | ||
[4297] | 30 | Uint32 lastFrame; |
31 | Uint32 currFrame; | |
[4554] | 32 | |
[4333] | 33 | Uint8* keys; // This variable will be used in the keyboard routine |
[4306] | 34 | bool mouseDown[MOUSE_BUTTON_COUNT]; |
[2931] | 35 | |
[4297] | 36 | public: |
[4554] | 37 | ~Framework(); |
38 | ||
[4519] | 39 | /** \returns a Pointer to the only object of this Class */ |
40 | inline static Framework* getInstance(void) { if (!singletonRef) singletonRef = new Framework(); return singletonRef; }; | |
[4317] | 41 | |
[4331] | 42 | |
[4343] | 43 | void moduleInit(int argc, char** argv); |
44 | #ifdef GUI_MODULE | |
45 | void moduleInitGui(int argc, char** argv); | |
46 | #endif | |
[4334] | 47 | void moduleEventHandler(SDL_Event* event); |
48 | void moduleTick(float dt); | |
[4349] | 49 | void moduleDraw(void) const; |
[4554] | 50 | |
[4333] | 51 | void moduleHelp(void) const; |
52 | ||
53 | ||
54 | ||
[4330] | 55 | static void* mainLoop(void* tmp); |
[4297] | 56 | bool draw(float dt); |
57 | float tick(); | |
[4334] | 58 | bool eventHandler(); |
[4331] | 59 | void quit(); |
[4307] | 60 | |
[4330] | 61 | static void* mainloopGui(void* tmp); |
[4316] | 62 | |
[4307] | 63 | void printHelp(void) const; |
[4297] | 64 | }; |
[4330] | 65 | |
[4343] | 66 | #ifdef GUI_MODULE |
[4333] | 67 | int quitGui(GtkWidget* widget, void* data); |
[4343] | 68 | #endif |
[4333] | 69 | |
[2931] | 70 | #endif /* _FRAMEWORK_H */ |
Note: See TracBrowser
for help on using the repository browser.