summaryrefslogtreecommitdiffstats
path: root/examples/opengl/hellowindow/hellowindow.h
diff options
context:
space:
mode:
authorSamuel Rødal <samuel.rodal@nokia.com>2011-04-27 17:49:30 +0200
committerSamuel Rødal <samuel.rodal@nokia.com>2011-04-28 15:39:54 +0200
commitf1601a4930ea138955569ebc489d7d73e469b21b (patch)
tree26a955fb7d343c531a78ab3f61c92e54ab147c82 /examples/opengl/hellowindow/hellowindow.h
parentbbee0db8f99a6a2f3926ca1b4118189fb5a957dc (diff)
Added QWindow example in examples/opengl/hellowindow.
(cherry picked from commit 712f5fe0acc7ef73117151cd8206a0d4f5d01428)
Diffstat (limited to 'examples/opengl/hellowindow/hellowindow.h')
-rw-r--r--examples/opengl/hellowindow/hellowindow.h44
1 files changed, 44 insertions, 0 deletions
diff --git a/examples/opengl/hellowindow/hellowindow.h b/examples/opengl/hellowindow/hellowindow.h
new file mode 100644
index 0000000000..ffa1f7d552
--- /dev/null
+++ b/examples/opengl/hellowindow/hellowindow.h
@@ -0,0 +1,44 @@
+#include <QWindow>
+
+#include <QtOpenGL/qgl.h>
+#include <QtOpenGL/qglshaderprogram.h>
+
+#include <QTime>
+
+class HelloWindow : public QWindow
+{
+ Q_OBJECT
+public:
+ HelloWindow();
+
+protected:
+ void mousePressEvent(QMouseEvent *);
+
+private slots:
+ void render();
+
+private:
+ void initialize();
+ void updateColor();
+
+ GLuint m_uiTexture;
+ qreal m_fAngle;
+ qreal m_fScale;
+ bool m_showBubbles;
+ void paintQtLogo();
+ void createGeometry();
+ void createBubbles(int number);
+ void quad(qreal x1, qreal y1, qreal x2, qreal y2, qreal x3, qreal y3, qreal x4, qreal y4);
+ void extrude(qreal x1, qreal y1, qreal x2, qreal y2);
+ QVector<QVector3D> vertices;
+ QVector<QVector3D> normals;
+ bool qtLogo;
+ int frames;
+ QTime time;
+ QGLShaderProgram program;
+ int vertexAttr;
+ int normalAttr;
+ int matrixUniform;
+ int colorUniform;
+ uint colorIndex;
+};