00001
00009
00010
00011
00012
00013
00014 #if GFXSYS_OPENGL
00015 #ifndef INP_JOYSTICK_GLUT_HH
00016 #define INP_JOYSTICK_GLUT_HH 1
00017
00018 #include "gfx.hh"
00019
00020 namespace inp {
00021
00022 class Global;
00023
00027 class JoystickGlut : public Joystick
00028 {
00029
00030 friend class Global;
00031
00032 private:
00033 JoystickGlut( void );
00034 ~JoystickGlut();
00035
00036 public:
00037 void PrintStatus( void );
00038
00039 private:
00040 bool Open( void );
00041 void Close( void );
00042 bool PollEvent( Event& event );
00043 CLASS_METHOD void GlutCallback( unsigned int buttonMask, int x, int y, int z );
00044 void EnqueueGlutEvent( unsigned int buttonMask, int x, int y, int z );
00045
00046 private:
00048 struct GlutEvent
00049 {
00050 GlutEvent( void ) : mButtonMask(0), mX(0), mY(0), mZ(0) { }
00051 uint mButtonMask;
00052 int mX, mY, mZ;
00053 };
00054
00055 private:
00056 CLASS_VAR JoystickGlut* msJoystickGlutInstance;
00057 const uint mMaxAxis;
00058 const uint mMaxButtons;
00059 bool mRegisteredWithGlut;
00060 GlutEvent mPrevGlutEvent;
00061 deque<Joystick::Event> mQueue;
00062 };
00063
00064 }
00065
00066 #endif // INP_JOYSTICK_GLUT_HH
00067 #endif // GFXSYS_OPENGL