summaryrefslogtreecommitdiffstats
path: root/examples/opengl/legacy/overpainting
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@theqtcompany.com>2015-05-18 10:31:33 +0200
committerFriedemann Kleint <Friedemann.Kleint@theqtcompany.com>2015-05-23 08:59:14 +0000
commitcab7e7858ae97eedc122fdfa7df082cbdb590d7c (patch)
treefcbb972506722b3443cd4cbb62c5a7169e08fc5c /examples/opengl/legacy/overpainting
parent4476966e0469dfdf372f6b1c119407acef37a6f2 (diff)
Make OpenGL legacy examples hellogl and overpainting work with Dynamic GL.
Call GL functions using QOpenGLFunctions_1_1. Task-number: QTBUG-46103 Change-Id: I1cbacf9c192c17d96d96aa861bb16e2918a0c053 Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
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.pro2
3 files changed, 6 insertions, 3 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 cbed7eed2b..cc46f18889 100644
--- a/examples/opengl/legacy/overpainting/overpainting.pro
+++ b/examples/opengl/legacy/overpainting/overpainting.pro
@@ -16,4 +16,4 @@ SOURCES = bubble.cpp \
target.path = $$[QT_INSTALL_EXAMPLES]/opengl/legacy/overpainting
INSTALLS += target
-contains(QT_CONFIG, opengles.|angle|dynamicgl):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")