diff options
author | Paul Lemire <paul.lemire350@gmail.com> | 2016-05-18 16:22:24 +0200 |
---|---|---|
committer | Sean Harmer <sean.harmer@kdab.com> | 2016-07-03 08:54:30 +0000 |
commit | 3f12da1b0f64265a0c2aee934249095d5cbc139a (patch) | |
tree | e335340aeb98a89a58fe536406ae7c9f87cfcfd9 /src/render/lights | |
parent | fb618bd26f3aca4a7910599ab856fb3cc767dccb (diff) |
Move LightSource to dedicated file
Change-Id: I62751e0f8460ab4680a7bd80eda0cc2a8011b1ef
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Diffstat (limited to 'src/render/lights')
-rw-r--r-- | src/render/lights/lights.pri | 6 | ||||
-rw-r--r-- | src/render/lights/lightsource.cpp | 64 | ||||
-rw-r--r-- | src/render/lights/lightsource_p.h | 81 |
3 files changed, 149 insertions, 2 deletions
diff --git a/src/render/lights/lights.pri b/src/render/lights/lights.pri index 1a7e8295c..408253d74 100644 --- a/src/render/lights/lights.pri +++ b/src/render/lights/lights.pri @@ -9,11 +9,13 @@ HEADERS += \ $$PWD/qpointlight_p.h \ $$PWD/qspotlight.h \ $$PWD/qspotlight_p.h \ - $$PWD/light_p.h + $$PWD/light_p.h \ + $$PWD/lightsource_p.h SOURCES += \ $$PWD/qabstractlight.cpp \ $$PWD/qdirectionallight.cpp \ $$PWD/qpointlight.cpp \ $$PWD/qspotlight.cpp \ - $$PWD/light.cpp + $$PWD/light.cpp \ + $$PWD/lightsource.cpp diff --git a/src/render/lights/lightsource.cpp b/src/render/lights/lightsource.cpp new file mode 100644 index 000000000..763e4763e --- /dev/null +++ b/src/render/lights/lightsource.cpp @@ -0,0 +1,64 @@ +/**************************************************************************** +** +** Copyright (C) 2016 Paul Lemire +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the Qt3D module of the Qt Toolkit. +** +** $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 +** 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 Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or (at your option) the GNU General +** Public license version 3 or 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.GPL2 and 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-2.0.html and +** https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "lightsource_p.h" +#include <Qt3DRender/private/entity_p.h> +#include <Qt3DRender/private/light_p.h> + +QT_BEGIN_NAMESPACE + +namespace Qt3DRender { + +namespace Render { + +LightSource::LightSource() : entity(nullptr) +{ +} + +LightSource::LightSource(Entity *entity, const QVector<Light *> &lights) + : entity(entity) + , lights(lights) +{ +} + +} // Render + +} // Qt3DRender + +QT_END_NAMESPACE diff --git a/src/render/lights/lightsource_p.h b/src/render/lights/lightsource_p.h new file mode 100644 index 000000000..9e56dc70e --- /dev/null +++ b/src/render/lights/lightsource_p.h @@ -0,0 +1,81 @@ +/**************************************************************************** +** +** Copyright (C) 2016 Paul Lemire +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the Qt3D module of the Qt Toolkit. +** +** $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 +** 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 Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or (at your option) the GNU General +** Public license version 3 or 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.GPL2 and 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-2.0.html and +** https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QT3DRENDER_RENDER_LIGHTSOURCE_P_H +#define QT3DRENDER_RENDER_LIGHTSOURCE_P_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists for the convenience +// of other Qt classes. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + +#include <Qt3DRender/qt3drender_global.h> +#include <QVector> + +QT_BEGIN_NAMESPACE + +namespace Qt3DRender { + +namespace Render { + +class Entity; +class Light; + +struct LightSource { + LightSource(); + LightSource(Entity *entity, const QVector<Light *> &lights); + + Entity *entity; + QVector<Light *> lights; +}; + +} // Render + +} // Qt3DRender + +QT_END_NAMESPACE + + +#endif // QT3DRENDER_RENDER_LIGHTSOURCE_P_H |