-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathGame.h
More file actions
101 lines (71 loc) · 1.87 KB
/
Game.h
File metadata and controls
101 lines (71 loc) · 1.87 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
/*
* Game.h
* Prototyp
*
* Created by Christian Pehle on 24.08.09.
* Copyright 2009 Universität Heidelberg. All rights reserved.
*
*/
#ifndef GAME_H
#define GAME_H
#if OGRE_PLATFORM == OGRE_PLATFORM_APPLE
#include <Carbon/Carbon.h>
#endif
#include <OIS/OISMouse.h>
#include <OIS/OISKeyboard.h>
#include <Ogre/Ogre.h>
#include "Input.h"
namespace Orbifold {
class GameState;
class Game :
public Ogre::WindowEventListener,
OIS::KeyListener,
OIS::MouseListener
{
public:
void static start();
void static stop();
// Callbacks for Inputhandling
bool mouseMoved(const OIS::MouseEvent &evt);
bool mousePressed(const OIS::MouseEvent &evt, OIS::MouseButtonID id);
bool mouseReleased(const OIS::MouseEvent &evt, OIS::MouseButtonID id);
bool keyPressed(const OIS::KeyEvent &evt);
bool keyReleased(const OIS::KeyEvent &evt);
static OIS::Mouse* getMouse();
static OIS::Keyboard* getKeyboard();
// Window handling
static Ogre::RenderWindow* getRenderWindow();
void windowResized(Ogre::RenderWindow* rw);
void windowMoved(Ogre::RenderWindow* rw);
bool windowClosing(Ogre::RenderWindow* rw);
void windowClosed(Ogre::RenderWindow* rw);
void windowFocusChange(Ogre::RenderWindow* rw);
// State handling
GameState* getCurrentState();
static bool requestStateChange(GameState* s);
protected:
static Game* instance;
bool running;
Ogre::Root* ogre;
Ogre::RenderWindow* window;
InputHandler* input;
GameState* state;
static Game* getSingleton();
void initialise();
void initOgreRoot();
void initPlugins();
void initRenderWindow();
void initOgreResources();
void initInput();
void initState();
void locateResources();
void loadResources();
//void reconfigure(const Ogre::String& renderer, Ogre::NameValuePairList& options);
void shutdown();
void shutdownInput();
private:
Game();
~Game();
};
}
#endif