Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/network/src/orxonox/InputHandler.h @ 918

Last change on this file since 918 was 918, checked in by rgrieder, 16 years ago
  • created basic construct for the InputHandler (mere copy of InputManager but without the Listeners)
  • some msvc related fixes with winsocks.h and winsocks2.h
  • fix in Tickable.h (due to lazy displacement to new folder)
File size: 2.0 KB
Line 
1/*
2 *   ORXONOX - the hottest 3D action shooter ever to exist
3 *
4 *
5 *   License notice:
6 *
7 *   This program is free software; you can redistribute it and/or
8 *   modify it under the terms of the GNU General Public License
9 *   as published by the Free Software Foundation; either version 2
10 *   of the License, or (at your option) any later version.
11 *
12 *   This program is distributed in the hope that it will be useful,
13 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
14 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 *   GNU General Public License for more details.
16 *
17 *   You should have received a copy of the GNU General Public License
18 *   along with this program; if not, write to the Free Software
19 *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
20 *
21 *   Author:
22 *      Reto Grieder
23 *   Co-authors:
24 *      ...
25 *
26 */
27
28/**
29 @file
30 @brief Implementation of a little Input handler that distributes everything
31        coming from OIS.
32 */
33
34#ifndef _InputHandler_H__
35#define _InputHandler_H__
36
37#include <OIS/OISPrereqs.h>
38#include <OIS/OISMouse.h>
39#include <OIS/OISKeyboard.h>
40
41#include <OgrePrerequisites.h>
42
43#include "OrxonoxPrereqs.h"
44#include "core/Tickable.h"
45
46namespace orxonox
47{
48  class _OrxonoxExport InputHandler : public Tickable, public OIS::KeyListener,
49                                      public OIS::MouseListener
50  {
51  public:
52    InputHandler();
53
54    void initialise(Ogre::RenderWindow *renderWindow);
55    void tick(float dt);
56    void setWindowExtents(int width, int height);
57
58    // input events
59                bool mousePressed (const OIS::MouseEvent &arg, OIS::MouseButtonID id);
60                bool mouseReleased(const OIS::MouseEvent &arg, OIS::MouseButtonID id);
61    bool mouseMoved   (const OIS::MouseEvent &arg);
62                bool keyPressed   (const OIS::KeyEvent   &arg);
63                bool keyReleased  (const OIS::KeyEvent   &arg);
64
65  private:
66    OIS::InputManager *inputSystem_;
67    OIS::Keyboard     *keyboard_;
68    OIS::Mouse        *mouse_;
69
70  };
71}
72
73#endif /* _InputHandler_H__ */
Note: See TracBrowser for help on using the repository browser.