summaryrefslogtreecommitdiffstats
path: root/examples/opengl/legacy/overpainting
diff options
context:
space:
mode:
Diffstat (limited to 'examples/opengl/legacy/overpainting')
-rw-r--r--examples/opengl/legacy/overpainting/glwidget.cpp4
-rw-r--r--examples/opengl/legacy/overpainting/glwidget.h3
-rw-r--r--examples/opengl/legacy/overpainting/overpainting.pro8
3 files changed, 7 insertions, 8 deletions
diff --git a/examples/opengl/legacy/overpainting/glwidget.cpp b/examples/opengl/legacy/overpainting/glwidget.cpp
index b41bc31126..52b6c35801 100644
--- a/examples/opengl/legacy/overpainting/glwidget.cpp
+++ b/examples/opengl/legacy/overpainting/glwidget.cpp
@@ -115,6 +115,8 @@ void GLWidget::setZRotation(int angle)
//! [2]
void GLWidget::initializeGL()
{
+ initializeOpenGLFunctions();
+
glEnable(GL_MULTISAMPLE);
logo = new QtLogo(this);
@@ -173,7 +175,7 @@ void GLWidget::paintEvent(QPaintEvent *event)
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]
//! [8]
diff --git a/examples/opengl/legacy/overpainting/glwidget.h b/examples/opengl/legacy/overpainting/glwidget.h
index dd5c0ba9ff..7e62a00170 100644
--- a/examples/opengl/legacy/overpainting/glwidget.h
+++ b/examples/opengl/legacy/overpainting/glwidget.h
@@ -42,13 +42,14 @@
#define GLWIDGET_H
#include <QGLWidget>
+#include <QOpenGLFunctions_1_1>
#include <QTimer>
class Bubble;
class QtLogo;
//! [0]
-class GLWidget : public QGLWidget
+class GLWidget : public QGLWidget, public QOpenGLFunctions_1_1
{
Q_OBJECT
diff --git a/examples/opengl/legacy/overpainting/overpainting.pro b/examples/opengl/legacy/overpainting/overpainting.pro
index c1bda7853d..cc46f18889 100644
--- a/examples/opengl/legacy/overpainting/overpainting.pro
+++ b/examples/opengl/legacy/overpainting/overpainting.pro
@@ -13,11 +13,7 @@ SOURCES = bubble.cpp \
qtlogo.cpp
# install
-target.path = $$[QT_INSTALL_EXAMPLES]/opengl/overpainting
+target.path = $$[QT_INSTALL_EXAMPLES]/opengl/legacy/overpainting
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")