From 0cbcc61ef35b9bce1d65d048853c79004b755b87 Mon Sep 17 00:00:00 2001 From: David Boddie Date: Wed, 11 May 2011 17:35:46 +0200 Subject: Squashed commit of changes from the 4.8-temp branch. --- examples/opengl/cube/mainwidget.h | 53 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 examples/opengl/cube/mainwidget.h (limited to 'examples/opengl/cube/mainwidget.h') diff --git a/examples/opengl/cube/mainwidget.h b/examples/opengl/cube/mainwidget.h new file mode 100644 index 0000000000..595173b65d --- /dev/null +++ b/examples/opengl/cube/mainwidget.h @@ -0,0 +1,53 @@ +#ifndef MAINWIDGET_H +#define MAINWIDGET_H + +#include + +#include +#include +#include + +class QBasicTimer; +class QGLShaderProgram; + +class GeometryEngine; + +class MainWidget : public QGLWidget +{ + Q_OBJECT +public: + explicit MainWidget(QWidget *parent = 0); + virtual ~MainWidget(); + +signals: + +public slots: + +protected: + void mousePressEvent(QMouseEvent *e); + void mouseReleaseEvent(QMouseEvent *e); + void timerEvent(QTimerEvent *e); + + void initializeGL(); + void resizeGL(int w, int h); + void paintGL(); + + void initShaders(); + void initTextures(); + +private: + QBasicTimer *timer; + QGLShaderProgram *program; + GeometryEngine *geometries; + + GLuint texture; + + QMatrix4x4 projection; + + QVector2D mousePressPosition; + QVector3D rotationAxis; + qreal angularSpeed; + QQuaternion rotation; +}; + +#endif // MAINWIDGET_H -- cgit v1.2.3