00001
00016 #ifndef __GLWIDGET_H_INCLUDED__
00017 #define __GLWIDGET_H_INCLUDED__
00018
00019 #include <QtCore/QTime>
00020 #include <QtOpenGL/QGLWidget>
00021
00022
00023 class ICameraState;
00024
00025
00026
00027
00028
00029
00039 class CGLWidget : public QGLWidget
00040 {
00041 Q_OBJECT
00042 public:
00047 CGLWidget( const QGLFormat & format, ICameraState* cs );
00048 virtual ~CGLWidget( void );
00049
00055 bool isSuccessfullyInitialized( void ) const { return m_initSucceeded; }
00056
00057
00062 QString getDriverInfoString( void ) const;
00063
00064 signals:;
00065
00072 void render( void );
00073
00074 private:
00075
00076
00077 QSize minimumSizeHint( void ) const;
00078 QSize sizeHint( void ) const;
00079
00080
00081 void paintGL( void );
00082 void initializeGL( void );
00083 void resizeGL( int width, int height );
00084
00085
00086 void timerEvent( QTimerEvent* timer );
00087 void mouseMoveEvent( QMouseEvent* event );
00088 void keyPressEvent( QKeyEvent* event );
00089
00090
00091 void drawFPS( void );
00092 int m_fpsCounter;
00093 int m_fpsValue;
00094 int m_fpsLastPeriod;
00095 QTime m_fpsTimer;
00096
00097
00098 QSize m_viewportSize;
00099
00100
00101 QPoint m_lastMousePosition;
00102
00103
00104 bool m_initSucceeded;
00105
00106
00107 ICameraState* m_cameraState;
00108 };
00109
00110
00111 #endif // __GLWIDGET_H_INCLUDED__
00112
00113