added missing files
[ltanks.git] / game.h
blobeafc7b1bd0b53541977fed3d57c65b35fa603b56
1 #ifndef GAME_H_DEFINED
2 #define GAME_H_DEFINED
4 #include <Ogre.h>
5 #include <OIS.h>
7 #define DATA_DIR "data/levels/"
8 #define MAP_SIZE 20
9 #define CUBE_SIZE 5
11 using namespace Ogre;
13 class Game : public OIS::KeyListener, public OIS::MouseListener {
14 private:
15 SceneManager *sceneMgr;
16 Camera *cam;
17 Viewport *vp;
18 SceneNode *map_node;
19 OverlayElement *cam_pos;
21 OIS::InputManager *input;
22 OIS::Keyboard *keyboard;
23 OIS::Mouse *mouse;
25 bool running;
26 int map[MAP_SIZE][MAP_SIZE];
28 void initInput(RenderWindow *win, bool buf);
29 void initCamera();
30 void initViewport(RenderWindow *win);
31 void setMouseArea(int w, int h);
33 bool loadLevel(const std::string &name);
36 public:
37 Game();
38 ~Game();
40 void init(Root *root, RenderWindow *win, bool buf = true);
42 void capture();
43 void update(unsigned long time);
45 void quit();
46 bool isRunning() {return running;};
48 void setWinSize(int w, int h);
50 bool keyPressed(const OIS::KeyEvent &e);
51 bool keyReleased(const OIS::KeyEvent &e);
53 bool mouseMoved(const OIS::MouseEvent &e);
54 bool mousePressed(const OIS::MouseEvent &e, OIS::MouseButtonID id);
55 bool mouseReleased(const OIS::MouseEvent &e, OIS::MouseButtonID id);
58 #endif