diff options
author | Laszlo Agocs <laszlo.agocs@qt.io> | 2019-03-21 20:42:38 +0100 |
---|---|---|
committer | Laszlo Agocs <laszlo.agocs@qt.io> | 2019-03-21 20:42:47 +0100 |
commit | 6767114285db9d0e16dc278d08f231e8561546b4 (patch) | |
tree | 0945902a2242fd7ec0a1f7fd3e6acbb769e723bd /examples/quick/scenegraph/graph/linenode.cpp | |
parent | ee076afedccbe1d37306a7972051f84eb036d655 (diff) | |
parent | c32b109e9dea44c6775c2dbf8f164870c1dc8971 (diff) |
Merge remote-tracking branch 'origin/dev' into wip/scenegraphng
Change-Id: Ib5662d80d5b2f58cf4634c54c054545ba9df807e
Diffstat (limited to 'examples/quick/scenegraph/graph/linenode.cpp')
-rw-r--r-- | examples/quick/scenegraph/graph/linenode.cpp | 30 |
1 files changed, 20 insertions, 10 deletions
diff --git a/examples/quick/scenegraph/graph/linenode.cpp b/examples/quick/scenegraph/graph/linenode.cpp index 992e2d44c9..cb7f1c8e7f 100644 --- a/examples/quick/scenegraph/graph/linenode.cpp +++ b/examples/quick/scenegraph/graph/linenode.cpp @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are @@ -56,29 +66,29 @@ class LineShader : public QSGSimpleMaterialShader<LineMaterial> QSG_DECLARE_SIMPLE_SHADER(LineShader, LineMaterial) public: - LineShader() : id_color(-1), id_spread(-1), id_size(-1) { + LineShader() { setShaderSourceFile(QOpenGLShader::Vertex, ":/scenegraph/graph/shaders/line.vsh"); setShaderSourceFile(QOpenGLShader::Fragment, ":/scenegraph/graph/shaders/line.fsh"); } - QList<QByteArray> attributes() const { return QList<QByteArray>() << "pos" << "t"; } + QList<QByteArray> attributes() const override { return QList<QByteArray>() << "pos" << "t"; } - void updateState(const LineMaterial *m, const LineMaterial *) { + void updateState(const LineMaterial *m, const LineMaterial *) override { program()->setUniformValue(id_color, m->color); program()->setUniformValue(id_spread, m->spread); program()->setUniformValue(id_size, m->size); } - void resolveUniforms() { + void resolveUniforms() override { id_spread = program()->uniformLocation("spread"); id_size = program()->uniformLocation("size"); id_color = program()->uniformLocation("color"); } private: - int id_color; - int id_spread; - int id_size; + int id_color = -1; + int id_spread = -1; + int id_size = -1; }; struct LineVertex { |