summaryrefslogtreecommitdiffstats
path: root/examples/opengl/textures
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.agocs@digia.com>2014-03-03 14:47:27 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-03-04 15:59:05 +0100
commit1e18df9c73e5431083ac2983c8899823d5ce259d (patch)
tree06a5014d1d87b04b7611cf496fd9e082a9e7ed98 /examples/opengl/textures
parent565f39aad1c02fda14f52fdd002eaba52abf8d27 (diff)
Extend QOpenGLFunctions with GL1 functions
This introduces the ability to indirectly invoke all common GL1-GLES2 functions via QOpenGLFunctions. The GL1 functions are not yet resolved, since this would not work anyway when linking to an OpenGL implementation directly. However this may change later but that will be a completely internal change without affecting any public APIs. Also migrate some of the opengl examples to use QOpenGLFunctions for everything. Once dynamic GL loading becomes available on some platforms, these examples should continue to function without any changes since they do not anymore invoke any OpenGL functions directly. Task-number: QTBUG-36483 Change-Id: Ie630029651e5a4863a480aac5306edd67ee36813 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
Diffstat (limited to 'examples/opengl/textures')
-rw-r--r--examples/opengl/textures/glwidget.cpp2
-rw-r--r--examples/opengl/textures/glwidget.h3
2 files changed, 4 insertions, 1 deletions
diff --git a/examples/opengl/textures/glwidget.cpp b/examples/opengl/textures/glwidget.cpp
index ac1e7965af..305ca1aa4c 100644
--- a/examples/opengl/textures/glwidget.cpp
+++ b/examples/opengl/textures/glwidget.cpp
@@ -83,6 +83,8 @@ void GLWidget::setClearColor(const QColor &color)
void GLWidget::initializeGL()
{
+ initializeOpenGLFunctions();
+
makeObject();
glEnable(GL_DEPTH_TEST);
diff --git a/examples/opengl/textures/glwidget.h b/examples/opengl/textures/glwidget.h
index fee47b9b48..b210b0fd8f 100644
--- a/examples/opengl/textures/glwidget.h
+++ b/examples/opengl/textures/glwidget.h
@@ -43,10 +43,11 @@
#include <QtWidgets>
#include <QGLWidget>
+#include <QOpenGLFunctions>
QT_FORWARD_DECLARE_CLASS(QGLShaderProgram);
-class GLWidget : public QGLWidget
+class GLWidget : public QGLWidget, protected QOpenGLFunctions
{
Q_OBJECT