summaryrefslogtreecommitdiffstats
path: root/examples/opengl/paintedwindow/paintedwindow.h
diff options
context:
space:
mode:
authorSamuel Rødal <[email protected]>2011-08-22 10:49:28 +0200
committerSamuel Rødal <[email protected]>2011-08-29 10:25:24 +0200
commit6e28e8441b698c3397c2c78125c877f2e9867cb1 (patch)
tree1e3ad0e43cb775854835817cd04bdc8b5e047e15 /examples/opengl/paintedwindow/paintedwindow.h
parentaaa4a26f82f99fa8724841eba91bad029306e0ce (diff)
Copy core GL functionality to QtGui with QGL -> QOpenGL naming.
Change-Id: Ibc989afa4a30dd184d41d1a1cd89f97196e48855 Reviewed-on: http://codereview.qt.nokia.com/3710 Reviewed-by: Gunnar Sletta <[email protected]>
Diffstat (limited to 'examples/opengl/paintedwindow/paintedwindow.h')
-rw-r--r--examples/opengl/paintedwindow/paintedwindow.h30
1 files changed, 30 insertions, 0 deletions
diff --git a/examples/opengl/paintedwindow/paintedwindow.h b/examples/opengl/paintedwindow/paintedwindow.h
new file mode 100644
index 00000000000..9e1b43638c8
--- /dev/null
+++ b/examples/opengl/paintedwindow/paintedwindow.h
@@ -0,0 +1,30 @@
+#include <QWindow>
+
+#include <QtGui/qopengl.h>
+#include <QtGui/qopenglshaderprogram.h>
+#include <QtGui/qopenglframebufferobject.h>
+
+#include <QColor>
+#include <QTime>
+
+class QOpenGLContext;
+
+class PaintedWindow : public QWindow
+{
+ Q_OBJECT
+public:
+ PaintedWindow();
+
+private slots:
+ void paint();
+
+private:
+ void resizeEvent(QResizeEvent *);
+
+ QOpenGLContext *m_context;
+ QOpenGLFramebufferObject *m_fbo;
+ QOpenGLShaderProgram *m_program;
+
+ GLuint m_vertexAttribute;
+ GLuint m_texCoordsAttribute;
+};