summaryrefslogtreecommitdiffstats
path: root/examples/opengl/legacy/hellogl
diff options
context:
space:
mode:
Diffstat (limited to 'examples/opengl/legacy/hellogl')
-rw-r--r--examples/opengl/legacy/hellogl/glwidget.cpp4
-rw-r--r--examples/opengl/legacy/hellogl/glwidget.h3
-rw-r--r--examples/opengl/legacy/hellogl/hellogl.pro8
3 files changed, 7 insertions, 8 deletions
diff --git a/examples/opengl/legacy/hellogl/glwidget.cpp b/examples/opengl/legacy/hellogl/glwidget.cpp
index 02501cd99e..122f7ddfe1 100644
--- a/examples/opengl/legacy/hellogl/glwidget.cpp
+++ b/examples/opengl/legacy/hellogl/glwidget.cpp
@@ -128,6 +128,8 @@ void GLWidget::setZRotation(int angle)
//! [6]
void GLWidget::initializeGL()
{
+ initializeOpenGLFunctions();
+
qglClearColor(qtPurple.dark());
logo = new QtLogo(this, 64);
@@ -153,7 +155,7 @@ void GLWidget::paintGL()
glRotatef(xRot / 16.0, 1.0, 0.0, 0.0);
glRotatef(yRot / 16.0, 0.0, 1.0, 0.0);
glRotatef(zRot / 16.0, 0.0, 0.0, 1.0);
- logo->draw();
+ logo->draw(static_cast<QOpenGLFunctions_1_1 *>(this));
}
//! [7]
diff --git a/examples/opengl/legacy/hellogl/glwidget.h b/examples/opengl/legacy/hellogl/glwidget.h
index 994e38e13d..9aca4451df 100644
--- a/examples/opengl/legacy/hellogl/glwidget.h
+++ b/examples/opengl/legacy/hellogl/glwidget.h
@@ -42,11 +42,12 @@
#define GLWIDGET_H
#include <QGLWidget>
+#include <QOpenGLFunctions_1_1>
class QtLogo;
//! [0]
-class GLWidget : public QGLWidget
+class GLWidget : public QGLWidget, public QOpenGLFunctions_1_1
{
Q_OBJECT
diff --git a/examples/opengl/legacy/hellogl/hellogl.pro b/examples/opengl/legacy/hellogl/hellogl.pro
index 500bd85b3c..c211242fd2 100644
--- a/examples/opengl/legacy/hellogl/hellogl.pro
+++ b/examples/opengl/legacy/hellogl/hellogl.pro
@@ -11,11 +11,7 @@ SOURCES = glwidget.cpp \
QT += opengl widgets
# install
-target.path = $$[QT_INSTALL_EXAMPLES]/opengl/hellogl
+target.path = $$[QT_INSTALL_EXAMPLES]/opengl/legacy/hellogl
INSTALLS += target
-contains(QT_CONFIG, opengles.) {
- contains(QT_CONFIG, angle): \
- warning("Qt was built with ANGLE, which provides only OpenGL ES 2.0 on top of DirectX 9.0c")
- error("This example requires Qt to be configured with -opengl desktop")
-}
+contains(QT_CONFIG, opengles.|angle):error("This example requires Qt to be configured with -opengl desktop")