Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/orxonox/trunk/src/subprojects/framework.h @ 4651

Last change on this file since 4651 was 4651, checked in by bensch, 19 years ago

orxonox/trunk: code-design

File size: 1.7 KB
Line 
1#ifndef _FRAMEWORK_H
2#define _FRAMEWORK_H
3
4#include "vector.h"
5#include "glincl.h"
6#include "SDL_events.h"
7#include "debug.h"
8#include "graphics_engine.h"
9
10#ifdef GUI_MODULE
11#include "gui_gtk.h"
12#endif
13
14#define MOUSE_BUTTON_COUNT 3
15
16class Camera;
17
18class Framework {
19  public:
20    ~Framework();
21
22    /** \returns a Pointer to the only object of this Class */
23    inline static    Framework* getInstance(void) { if (!singletonRef) singletonRef = new Framework();  return singletonRef; };
24
25  public:
26    void             moduleInit(int argc, char** argv);
27#ifdef GUI_MODULE
28    void             moduleInitGui(int argc, char** argv);
29#endif
30    void             moduleEventHandler(SDL_Event* event);
31  void               moduleTick(float dt);
32  void               moduleDraw(void) const;
33
34  void               moduleHelp(void) const;
35
36
37  void               init(void);
38  static void*       mainLoop(void* tmp);
39  bool               draw(float dt);
40  float              tick();
41  bool               eventHandler();
42  void               quit();
43
44  static void*       mainloopGui(void* tmp);
45
46  void               printHelp(void) const;
47
48
49  private:
50    Framework();
51
52  private:
53    static Framework*           singletonRef;
54
55    Camera*                     camera;
56
57    bool                        isFinished;
58
59    int                         movement [4];
60    float                       backgroundColor[4];
61
62    Uint32                      lastFrame;
63    Uint32                      currFrame;
64
65    Uint8*                      keys;        // This variable will be used in the keyboard routine
66    bool                        mouseDown[MOUSE_BUTTON_COUNT];
67
68};
69
70#ifdef GUI_MODULE
71int quitGui(GtkWidget* widget, void* data);
72#endif
73
74#endif /* _FRAMEWORK_H */
Note: See TracBrowser for help on using the repository browser.