OISInput.h

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 /* GG is a GUI for SDL and OpenGL.
00003    Copyright (C) 2007 T. Zachary Laine
00004 
00005    This library is free software; you can redistribute it and/or
00006    modify it under the terms of the GNU Lesser General Public License
00007    as published by the Free Software Foundation; either version 2.1
00008    of the License, or (at your option) any later version.
00009    
00010    This library is distributed in the hope that it will be useful,
00011    but WITHOUT ANY WARRANTY; without even the implied warranty of
00012    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013    Lesser General Public License for more details.
00014     
00015    You should have received a copy of the GNU Lesser General Public
00016    License along with this library; if not, write to the Free
00017    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
00018    02111-1307 USA
00019 
00020    If you do not wish to comply with the terms of the LGPL please
00021    contact the author as other terms are available for a fee.
00022     
00023    Zach Laine
00024    whatwasthataddress@hotmail.com */
00025    
00029 #include "OgreGUIInputPlugin.h"
00030 
00031 #include <OIS/OISKeyboard.h>
00032 #include <OIS/OISMouse.h>
00033 
00034 
00035 namespace OIS { class InputManager; }
00036 
00041 class GG_OGRE_PLUGIN_API OISInput :
00042     public GG::OgreGUIInputPlugin,
00043     public OIS::MouseListener,
00044     public OIS::KeyListener
00045 {
00046 public:
00047     OISInput();
00048     virtual ~OISInput();
00049 
00050     virtual const Ogre::String& getName() const;
00051     virtual void install();
00052     virtual void initialise();
00053     virtual void shutdown();
00054     virtual void uninstall();
00055 
00056 private:
00057     virtual void HandleSystemEvents();
00058     virtual void HandleWindowResize(int width, int height);
00059     virtual void HandleWindowClose();
00060 
00061     virtual bool mouseMoved(const OIS::MouseEvent &event);
00062     virtual bool mousePressed(const OIS::MouseEvent &event, OIS::MouseButtonID id);
00063     virtual bool mouseReleased(const OIS::MouseEvent &event, OIS::MouseButtonID id);
00064 
00065     virtual bool keyPressed(const OIS::KeyEvent& event);
00066     virtual bool keyReleased(const OIS::KeyEvent& event);
00067 
00068     void CleanupInputManager();
00069 
00070     OIS::InputManager*  m_input_manager;
00071     OIS::Mouse*         m_mouse;
00072     OIS::Keyboard*      m_keyboard;
00073 };

Generated on Wed Mar 26 14:35:42 2008 for GG by  doxygen 1.5.2