Main Page | Modules | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

Joystick.h

Go to the documentation of this file.
00001 #ifndef __JOYSTICK_CONTROLLER_H
00002 #define __JOYSTICK_CONTROLLER_H
00003 
00004 #ifdef HAVE_VIEWER
00005 
00006 #include "Controller.h"
00007 
00013 
00014 #define JOYSTICK_NB_BUTTONS 8
00015 
00016 struct _SDL_Joystick;
00017 
00018 namespace Teem
00019 {
00022     class JoystickController : public Controller
00023     {
00024     public:
00026         JoystickController();
00027         virtual ~JoystickController();
00028         
00030         virtual void setInput(unsigned index, double val)
00031         {
00032             assert(false);
00033         }
00034         
00036         virtual double getOutput(unsigned index)
00037         {
00038 //          assert(index < 4);
00039             return output[index];
00040         }
00041         
00042         virtual void step();
00043         
00045         bool isButtonDown(unsigned button);
00046         
00047     protected:
00048         double output[JOYSTICK_NB_BUTTONS]; 
00049         struct _SDL_Joystick *joy; 
00050     };
00051 }
00052 
00053 #endif // HAVE_VIEWER
00054 
00055 #endif

Generated on Mon Oct 24 17:38:25 2005 for Teem by  doxygen 1.4.2