diff options
Diffstat (limited to 'src/datavisualization/utils/shaderhelper.cpp')
-rw-r--r-- | src/datavisualization/utils/shaderhelper.cpp | 41 |
1 files changed, 10 insertions, 31 deletions
diff --git a/src/datavisualization/utils/shaderhelper.cpp b/src/datavisualization/utils/shaderhelper.cpp index ba029be2..7de9592d 100644 --- a/src/datavisualization/utils/shaderhelper.cpp +++ b/src/datavisualization/utils/shaderhelper.cpp @@ -1,37 +1,11 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Qt Data Visualization module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL$ -** 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. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 or (at your option) any later version -** approved by the KDE Free Qt Foundation. The licenses are as published by -** the Free Software Foundation and appearing in the file LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ +// Copyright (C) 2016 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include "shaderhelper_p.h" #include <QtOpenGL/QOpenGLShader> -QT_BEGIN_NAMESPACE_DATAVISUALIZATION +QT_BEGIN_NAMESPACE void discardDebugMsgs(QtMsgType type, const QMessageLogContext &context, const QString &msg) { @@ -113,7 +87,12 @@ void ShaderHelper::initialize() qFatal("Compiling Vertex shader failed"); if (!m_program->addShaderFromSourceFile(QOpenGLShader::Fragment, m_fragmentShaderFile)) qFatal("Compiling Fragment shader failed"); - m_program->link(); + + if (!m_program->link()) { + qWarning() << "Unable to link shader program:" << + m_vertexShaderFile << m_fragmentShaderFile; + return; + } m_positionAttr = m_program->attributeLocation("vertexPosition_mdl"); m_normalAttr = m_program->attributeLocation("vertexNormal_mdl"); @@ -416,4 +395,4 @@ GLint ShaderHelper::normalAtt() return m_normalAttr; } -QT_END_NAMESPACE_DATAVISUALIZATION +QT_END_NAMESPACE |