summaryrefslogtreecommitdiffstats
path: root/src/charts/glwidget.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/charts/glwidget.cpp')
-rw-r--r--src/charts/glwidget.cpp31
1 files changed, 21 insertions, 10 deletions
diff --git a/src/charts/glwidget.cpp b/src/charts/glwidget.cpp
index 7ce0ef12..c0070dcd 100644
--- a/src/charts/glwidget.cpp
+++ b/src/charts/glwidget.cpp
@@ -1,23 +1,31 @@
-/******************************************************************************
+/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
-** This file is part of the Qt Charts module.
-**
-** $QT_BEGIN_LICENSE:COMM$
+** This file is part of the Qt Charts 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 http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** 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$
**
-******************************************************************************/
+****************************************************************************/
#ifndef QT_NO_OPENGL
@@ -101,9 +109,10 @@ static const char *vertexSource =
"uniform highp vec2 min;\n"
"uniform highp vec2 delta;\n"
"uniform highp float pointSize;\n"
+ "uniform highp mat4 matrix;\n"
"void main() {\n"
" vec2 normalPoint = vec2(-1, -1) + ((points - min) / delta);\n"
- " gl_Position = vec4(normalPoint, 0, 1);\n"
+ " gl_Position = matrix * vec4(normalPoint, 0, 1);\n"
" gl_PointSize = pointSize;\n"
"}";
static const char *fragmentSource =
@@ -130,6 +139,7 @@ void GLWidget::initializeGL()
m_minUniformLoc = m_program->uniformLocation("min");
m_deltaUniformLoc = m_program->uniformLocation("delta");
m_pointSizeUniformLoc = m_program->uniformLocation("pointSize");
+ m_matrixUniformLoc = m_program->uniformLocation("matrix");
// Create a vertex array object. In OpenGL ES 2.0 and OpenGL 2.x
@@ -171,6 +181,7 @@ void GLWidget::paintGL()
m_program->setUniformValue(m_colorUniformLoc, data->color);
m_program->setUniformValue(m_minUniformLoc, data->min);
m_program->setUniformValue(m_deltaUniformLoc, data->delta);
+ m_program->setUniformValue(m_matrixUniformLoc, data->matrix);
if (!vbo) {
vbo = new QOpenGLBuffer;