00001 #ifndef RENDERGROUPVIEWGLUT_H
00002 #define RENDERGROUPVIEWGLUT_H
00003
00004 #ifdef RT_GLUT
00005
00006 #include "Types.h"
00007 #include "RendergroupAbstractView.h"
00008 #include "MouseInterface.h"
00009 #include "KeyboardInterface.h"
00010
00011 #define DEVICENAME_GLUT = DEVICENAME_NEXT << 1
00012 #define DEVICENAME_LAST ( DEVICENAME_NEXT << 2 )
00013 #undef DEVICENAME_NEXT
00014 #define DEVICENAME_NEXT DEVICENAME_LAST
00015
00016 namespace RenderTools{
00017
00018 class RendergroupGLutView;
00019 typedef shared_ptr< RendergroupGLutView > RendergroupGLutViewPtr;
00020
00021 class RendergroupGLutView : public RendergroupAbstractView, public MouseInterface, public KeyboardInterface {
00022 public:
00023
00024 RendergroupGLutView( void );
00025 virtual ~RendergroupGLutView( void );
00026
00027 static PropertyPtr create( const XMLNodePtr & xml = XMLNodePtr() );
00028 virtual void createProperties( void );
00029 virtual const string getTypeName( bool ofComponent = false ) const;
00030
00031 virtual void show( bool state = true );
00032 virtual void startTimer( unsigned int millis = 30 );
00033 virtual void stopTimer( void );
00034 virtual void onInitialize( void );
00035 virtual void onRender( void );
00036 virtual void onUpdate( Mat4 & parent = Mat4() );
00037
00038 virtual void onPropertyEvent( const PropertyEvent & );
00039 virtual void onPropertyContainerEvent( const PropertyContainerEvent & );
00040 virtual void onViewControllerEvent( const ViewControllerEvent & );
00041 virtual void onMouseEvent( const MouseEvent & );
00042 virtual void onKeyboardEvent( const KeyboardEvent & );
00043
00044 protected:
00045 static void displayFunc( void );
00046 static void timerFunc( int value );
00047 static void idleFunc( void );
00048 static void keyPressFunc( unsigned char key, int x, int y );
00049 static void keyReleaseFunc( unsigned char key, int x, int y );
00050 static void resizeFunc( int w, int h );
00051 static void mouseFunc( int button, int state, int x, int y );
00052 static void motionFunc( int x, int y );
00053 static void passiveMotionFunc( int x, int y );
00054
00055 public:
00056
00057 static RendergroupGLutViewPtr s_instance;
00058 static bool s_fullscreen;
00059 };
00060
00061 };
00062
00063 #endif //RT_GLUT
00064
00065 #endif
00066