diff options
Diffstat (limited to 'src/datavis3d/engine/q3dwindow.cpp')
-rw-r--r-- | src/datavis3d/engine/q3dwindow.cpp | 74 |
1 files changed, 18 insertions, 56 deletions
diff --git a/src/datavis3d/engine/q3dwindow.cpp b/src/datavis3d/engine/q3dwindow.cpp index af975cb1..5b2b70ab 100644 --- a/src/datavis3d/engine/q3dwindow.cpp +++ b/src/datavis3d/engine/q3dwindow.cpp @@ -1,41 +1,18 @@ /**************************************************************************** ** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal +** Copyright (C) 2013 Digia Plc +** All rights reserved. +** For any questions to Digia, please use contact form at http://qt.digia.com ** ** This file is part of the QtDataVis3D module. ** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the +** Licensees holding valid Qt Enterprise licenses may use this file in +** accordance with the Qt Enterprise License Agreement provided with the ** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. +** a written agreement between you and Digia. ** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** -** $QT_END_LICENSE$ +** If you have questions regarding the use of this file, please use +** contact form at http://qt.digia.com ** ****************************************************************************/ @@ -50,7 +27,7 @@ #include <QDebug> -QTENTERPRISE_DATAVIS3D_BEGIN_NAMESPACE +QT_DATAVIS3D_BEGIN_NAMESPACE /*! * \class Q3DWindow @@ -95,28 +72,13 @@ Q3DWindow::Q3DWindow(QWindow *parent) qDebug() << "initializeOpenGLFunctions()"; initializeOpenGLFunctions(); - initialize(); -} - -/*! - * Destroys Q3DWindow. - */ -Q3DWindow::~Q3DWindow() -{ -} - -/*! - * \internal - */ -void Q3DWindow::initialize() -{ const GLubyte *version = glGetString(GL_VERSION); qDebug() << "OpenGL version:" << (const char *)version; version = glGetString(GL_SHADING_LANGUAGE_VERSION); qDebug() << "GLSL version:" << (const char *)version; #if !defined(QT_OPENGL_ES_2) // If we have real OpenGL, GLSL version must be 1.2 or over. Quit if not. - QStringList splitversionstr = QString((const char *)version).split(" "); + QStringList splitversionstr = QString::fromLatin1((const char *)version).split(QChar::fromLatin1(' ')); if (splitversionstr[0].toFloat() < 1.2) qFatal("GLSL version must be 1.20 or higher. Try installing latest display drivers."); #endif @@ -124,6 +86,13 @@ void Q3DWindow::initialize() } /*! + * Destroys Q3DWindow. + */ +Q3DWindow::~Q3DWindow() +{ +} + +/*! * \internal */ void Q3DWindow::render() @@ -174,17 +143,10 @@ void Q3DWindow::renderNow() if (!isExposed()) return; - static bool needsInit = true; - d_ptr->m_updatePending = false; d_ptr->m_context->makeCurrent(this); - if (needsInit) { - initialize(); - needsInit = false; - } - render(); d_ptr->m_context->swapBuffers(this); @@ -216,4 +178,4 @@ Q3DWindowPrivate::~Q3DWindowPrivate() { } -QTENTERPRISE_DATAVIS3D_END_NAMESPACE +QT_DATAVIS3D_END_NAMESPACE |