inp_joystick_glut.hh

Go to the documentation of this file.
00001 /*
00009  * LEGAL:   COPYRIGHT (C) 2007 JIM E. BROOKS
00010  *          THIS SOURCE CODE IS RELEASED UNDER THE TERMS
00011  *          OF THE GNU GENERAL PUBLIC LICENSE VERSION 2 (GPL 2).
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 /*OUT*/ );
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;  // for class method GlutCallback()
00057     const uint              mMaxAxis;
00058     const uint              mMaxButtons;
00059     bool                    mRegisteredWithGlut;
00060     GlutEvent               mPrevGlutEvent;
00061     deque<Joystick::Event>  mQueue;
00062 };
00063 
00064 } // namespace inp
00065 
00066 #endif // INP_JOYSTICK_GLUT_HH
00067 #endif // GFXSYS_OPENGL
Palomino 3D Engine documents generated by doxygen 1.5.3 on Fri Nov 23 11:26:11 2007