Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

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

orxonox/trunk: code-design

File size: 1.7 KB
RevLine 
[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"
[4651]8#include "graphics_engine.h"
[2931]9
[4343]10#ifdef GUI_MODULE
[4333]11#include "gui_gtk.h"
[4554]12#endif
[4297]13
[4650]14#define MOUSE_BUTTON_COUNT 3
[4295]15
[4297]16class Camera;
[2952]17
[4297]18class Framework {
[4651]19  public:
20    ~Framework();
[4554]21
[4651]22    /** \returns a Pointer to the only object of this Class */
23    inline static    Framework* getInstance(void) { if (!singletonRef) singletonRef = new Framework();  return singletonRef; };
[4554]24
[4651]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;
[4317]33
[4651]34  void               moduleHelp(void) const;
[4374]35
[4554]36
[4651]37  void               init(void);
38  static void*       mainLoop(void* tmp);
39  bool               draw(float dt);
40  float              tick();
41  bool               eventHandler();
42  void               quit();
[2931]43
[4651]44  static void*       mainloopGui(void* tmp);
[4554]45
[4651]46  void               printHelp(void) const;
[4317]47
[4331]48
[4651]49  private:
50    Framework();
[4554]51
[4651]52  private:
53    static Framework*           singletonRef;
[4333]54
[4651]55    Camera*                     camera;
[4333]56
[4651]57    bool                        isFinished;
[4307]58
[4651]59    int                         movement [4];
60    float                       backgroundColor[4];
[4316]61
[4651]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
[4297]68};
[4330]69
[4343]70#ifdef GUI_MODULE
[4333]71int quitGui(GtkWidget* widget, void* data);
[4343]72#endif
[4333]73
[2931]74#endif /* _FRAMEWORK_H */
Note: See TracBrowser for help on using the repository browser.