summaryrefslogtreecommitdiffstats
path: root/examples/opengl/qopenglwindow/background_renderer.h
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@qt.io>2019-08-06 12:24:37 +0200
committerLars Knoll <lars.knoll@qt.io>2019-08-07 12:50:28 +0200
commit05b90be3c5ce4709156178478abb2e7ba125a0be (patch)
treea7c39b76c99f4887dbc6837be3a41afc7fdb29b4 /examples/opengl/qopenglwindow/background_renderer.h
parent7301e44161d8bb25410219a31405584c9492b83e (diff)
parent6f357f50b4b72e3c5a6903a09624ade1d72d12c1 (diff)
Merge "Merge remote-tracking branch 'origin/dev' into wip/qt6"
Diffstat (limited to 'examples/opengl/qopenglwindow/background_renderer.h')
-rw-r--r--examples/opengl/qopenglwindow/background_renderer.h11
1 files changed, 7 insertions, 4 deletions
diff --git a/examples/opengl/qopenglwindow/background_renderer.h b/examples/opengl/qopenglwindow/background_renderer.h
index d99b7ddbeb..0e3caf5981 100644
--- a/examples/opengl/qopenglwindow/background_renderer.h
+++ b/examples/opengl/qopenglwindow/background_renderer.h
@@ -62,11 +62,14 @@
#include <QOpenGLShaderProgram>
#include <QOpenGLFunctions>
+#include <memory>
+
class FragmentToy : public QObject, protected QOpenGLFunctions
{
Q_OBJECT
public:
- FragmentToy(const QString &fragmentSource, QObject *parent = 0);
+ explicit FragmentToy(const QString &fragmentSource, QObject *parent = nullptr);
+ ~FragmentToy();
void draw(const QSize &windowSize);
@@ -79,9 +82,9 @@ private:
QString m_fragment_file;
QDateTime m_fragment_file_last_modified;
- QScopedPointer<QOpenGLShaderProgram> m_program;
- QScopedPointer<QOpenGLShader> m_vertex_shader;
- QScopedPointer<QOpenGLShader> m_fragment_shader;
+ std::unique_ptr<QOpenGLShaderProgram> m_program;
+ std::unique_ptr<QOpenGLShader> m_vertex_shader;
+ std::unique_ptr<QOpenGLShader> m_fragment_shader;
QOpenGLVertexArrayObject m_vao;
QOpenGLBuffer m_vertex_buffer;
GLuint m_vertex_coord_pos;