diff options
author | Sarah Smith <sarah.j.smith@nokia.com> | 2011-12-21 14:45:00 +1000 |
---|---|---|
committer | Sarah Jane Smith <sarah.j.smith@nokia.com> | 2011-12-21 08:57:36 +0100 |
commit | aedf27c0aa3e3d037392335ea96d37e3a9a8b811 (patch) | |
tree | fec10b3fff19f2cb6e0d3640d73a4ebb7a1fe804 | |
parent | a7db0a7405e3511ef8a78f0ff1cdb3b1ecd92157 (diff) |
Make Qt3D buildable without widgets or opengl.
Pull out all references to QGLContext, and QGLWidget and so on; and
replace with the equivalent from the gui library. Where there is no
equivalent, eg the BindOptions enum, then reimplement.
Also get rid of the harmattan and symbian packaging goop. This had
become completely unmaintainable, and was making it very hard to see
what dependencies were being pull in by the various parts of the build
system. In order to have any confidence that conditional compilation
would not add in some problematic dependency, clean all this up.
Task-number: QTBUG-23299
Change-Id: Ied92ca1397076986e455674b064d8540bb13c0df
Reviewed-by: Sarah Jane Smith <sarah.j.smith@nokia.com>
280 files changed, 902 insertions, 2118 deletions
diff --git a/demos/qt3d/cubehouse/cubehouse.desktop b/demos/qt3d/cubehouse/cubehouse.desktop deleted file mode 100644 index 1a530fa21..000000000 --- a/demos/qt3d/cubehouse/cubehouse.desktop +++ /dev/null @@ -1,8 +0,0 @@ -[Desktop Entry] -Type=Application -Name=CubeHouse -Icon=icon-l-qt3d -Exec=/usr/bin/cubehouse -fullscreen -OnlyShowIn=X-MeeGo; -X-MeeGo-Logical-Id=qtn_comm_appname_cubehouse -X-MeeGo-Translation-Catalog=essentials diff --git a/demos/qt3d/cubehouse/cubehouse.pro b/demos/qt3d/cubehouse/cubehouse.pro index 46eda3d2d..a0b95465a 100644 --- a/demos/qt3d/cubehouse/cubehouse.pro +++ b/demos/qt3d/cubehouse/cubehouse.pro @@ -1,10 +1,7 @@ TEMPLATE = app TARGET = cubehouse CONFIG += qt warn_on -QT += widgets qt3d - -CONFIG += qt3d_deploy_pkg -include(../../../pkg.pri) +QT += qt3d SOURCES = cubeview.cpp main.cpp projectivetextureeffect.cpp HEADERS = cubeview.h projectivetextureeffect.h diff --git a/demos/qt3d/cubehouse/icon-l-qt3d.png b/demos/qt3d/cubehouse/icon-l-qt3d.png Binary files differdeleted file mode 100644 index 07cc4092d..000000000 --- a/demos/qt3d/cubehouse/icon-l-qt3d.png +++ /dev/null diff --git a/demos/qt3d/cubehouse/m5-cubehouse.desktop b/demos/qt3d/cubehouse/m5-cubehouse.desktop deleted file mode 100644 index 9b1bd54a1..000000000 --- a/demos/qt3d/cubehouse/m5-cubehouse.desktop +++ /dev/null @@ -1,14 +0,0 @@ -[Desktop Entry] -Encoding=UTF-8 -Version=1.0 -Name=CubeHouse -Comment=Qt3D example application -Exec=/usr/bin/cubehouse -fullscreen -Icon=icon-l-qt3d -Terminal=false -Type=Application -Categories=Development; -X-HildonDesk-ShowInToolbar=true -X-Osso-Type=application/x-executable -X-Text-Domain=qt3d - diff --git a/demos/qt3d/cubehouse/main.cpp b/demos/qt3d/cubehouse/main.cpp index 2b9e0a9f9..37ec6e7a3 100644 --- a/demos/qt3d/cubehouse/main.cpp +++ b/demos/qt3d/cubehouse/main.cpp @@ -39,12 +39,13 @@ ** ****************************************************************************/ -#include <QApplication> +#include <QGuiApplication> + #include "cubeview.h" int main(int argc, char *argv[]) { - QApplication app(argc, argv); + QGuiApplication app(argc, argv); CubeView view; QStringList args = QCoreApplication::arguments(); diff --git a/demos/qt3d/cubehouse/projectivetextureeffect.cpp b/demos/qt3d/cubehouse/projectivetextureeffect.cpp index 07bb4f5d7..1a63ac850 100644 --- a/demos/qt3d/cubehouse/projectivetextureeffect.cpp +++ b/demos/qt3d/cubehouse/projectivetextureeffect.cpp @@ -41,7 +41,8 @@ #include <QFile> #include "projectivetextureeffect.h" -#include <QtOpenGL/qglshaderprogram.h> + +#include <QOpenGLShaderProgram> static const QMatrix4x4 biasMatrix = QMatrix4x4(0.5, 0.0, 0.0, 0.5, 0.0, 0.5, 0.0, 0.5, diff --git a/demos/qt3d/pageflip/icon-l-qt3d.png b/demos/qt3d/pageflip/icon-l-qt3d.png Binary files differdeleted file mode 100644 index 07cc4092d..000000000 --- a/demos/qt3d/pageflip/icon-l-qt3d.png +++ /dev/null diff --git a/demos/qt3d/pageflip/m5-pageflip.desktop b/demos/qt3d/pageflip/m5-pageflip.desktop deleted file mode 100644 index 772a3f628..000000000 --- a/demos/qt3d/pageflip/m5-pageflip.desktop +++ /dev/null @@ -1,14 +0,0 @@ -[Desktop Entry] -Encoding=UTF-8 -Version=1.0 -Name=Pageflip -Comment=Qt3D example application -Exec=/usr/bin/pageflip -fullscreen -Icon=icon-l-qt3d -Terminal=false -Type=Application -Categories=Development; -X-HildonDesk-ShowInToolbar=true -X-Osso-Type=application/x-executable -X-Text-Domain=qt3d - diff --git a/demos/qt3d/pageflip/pageflip.cpp b/demos/qt3d/pageflip/pageflip.cpp index 7dcbdad2d..f96df2517 100644 --- a/demos/qt3d/pageflip/pageflip.cpp +++ b/demos/qt3d/pageflip/pageflip.cpp @@ -39,16 +39,18 @@ ** ****************************************************************************/ -#include <QApplication> +#include <QGuiApplication> #include <QTimer> #include <QMouseEvent> #include <QWindow> +#include <QOpenGLContext> +#include <QOpenGLShaderProgram> + #include "qglpainter.h" #include "qglabstracteffect.h" #include "qgltexture2d.h" #include "qglshaderprogrameffect.h" -#include <QtGui/QOpenGLContext> -#include <QtOpenGL/qglshaderprogram.h> + #include "pageflipmath_p.h" class PageFlipGradientEffect; @@ -359,7 +361,7 @@ void PageFlipView::update() if (!updateQueued) { updateQueued = true; - QApplication::postEvent(this, new QExposeEvent(geometry())); + QGuiApplication::postEvent(this, new QExposeEvent(geometry())); } } @@ -435,7 +437,7 @@ inline void PageFlipView::ensureContext() int main(int argc, char *argv[]) { - QApplication app(argc, argv); + QGuiApplication app(argc, argv); PageFlipView view; QStringList args = QCoreApplication::arguments(); diff --git a/demos/qt3d/pageflip/pageflip.desktop b/demos/qt3d/pageflip/pageflip.desktop deleted file mode 100644 index 5b75c596f..000000000 --- a/demos/qt3d/pageflip/pageflip.desktop +++ /dev/null @@ -1,8 +0,0 @@ -[Desktop Entry] -Type=Application -Name=Pageflip -Icon=icon-l-qt3d -Exec=/usr/bin/pageflip -fullscreen -OnlyShowIn=X-MeeGo; -X-MeeGo-Logical-Id=qtn_comm_appname_pageflip -X-MeeGo-Translation-Catalog=essentials diff --git a/demos/qt3d/pageflip/pageflip.pro b/demos/qt3d/pageflip/pageflip.pro index 9a49941dc..de95caaa6 100644 --- a/demos/qt3d/pageflip/pageflip.pro +++ b/demos/qt3d/pageflip/pageflip.pro @@ -1,7 +1,7 @@ TEMPLATE = app TARGET = pageflip CONFIG += qt warn_on -QT += widgets qt3d +QT += qt3d SOURCES = pageflip.cpp pageflipmath.cpp HEADERS = pageflipmath_p.h diff --git a/demos/qt3d/pageflip/pageflipmath_p.h b/demos/qt3d/pageflip/pageflipmath_p.h index 6ee391f54..586dd9af5 100644 --- a/demos/qt3d/pageflip/pageflipmath_p.h +++ b/demos/qt3d/pageflip/pageflipmath_p.h @@ -42,7 +42,9 @@ #ifndef PAGEFLIPMATH_P_H #define PAGEFLIPMATH_P_H -#include <QtOpenGL/qgl.h> +#include <QtGlobal> +#include <QRect> +#include <QOpenGLBuffer> QT_BEGIN_NAMESPACE diff --git a/demos/qt3d/photobrowser3d/bytereader.cpp b/demos/qt3d/photobrowser3d/bytereader.cpp index 3274a71a4..9fdcf72f7 100644 --- a/demos/qt3d/photobrowser3d/bytereader.cpp +++ b/demos/qt3d/photobrowser3d/bytereader.cpp @@ -49,6 +49,7 @@ #include <QUrl> #include <QFile> #include <QCoreApplication> +#include <QPainter> ByteReader::ByteReader() : m_stop(0), m_loading(0) diff --git a/demos/qt3d/photobrowser3d/icon-l-qt3d.png b/demos/qt3d/photobrowser3d/icon-l-qt3d.png Binary files differdeleted file mode 100644 index 07cc4092d..000000000 --- a/demos/qt3d/photobrowser3d/icon-l-qt3d.png +++ /dev/null diff --git a/demos/qt3d/photobrowser3d/imagedisplay.cpp b/demos/qt3d/photobrowser3d/imagedisplay.cpp index 924a2f973..27651a71c 100644 --- a/demos/qt3d/photobrowser3d/imagedisplay.cpp +++ b/demos/qt3d/photobrowser3d/imagedisplay.cpp @@ -51,8 +51,9 @@ #include "qphotobrowser3dscene.h" #include "photobrowser3dview.h" -#include <QApplication> +#include <QGuiApplication> #include <QChildEvent> +#include <QCloseEvent> #include <QUrl> #include <QImage> @@ -156,7 +157,7 @@ ImageDisplay::ImageDisplay(QObject *parent, QGLMaterialCollection *materials, qr m_frameImage = qMakeFrameImage(); mat = new QGLMaterial(); tex = new QGLTexture2D(mat); - tex->setHorizontalWrap(QGL::Clamp); + tex->setHorizontalWrap(QGL::ClampToEdge); tex->setImage(m_frameImage); mat->setTexture(tex); mat->setObjectName("loading image material - default"); diff --git a/demos/qt3d/photobrowser3d/imagedisplay.h b/demos/qt3d/photobrowser3d/imagedisplay.h index 44f8421c4..a2410d9bf 100644 --- a/demos/qt3d/photobrowser3d/imagedisplay.h +++ b/demos/qt3d/photobrowser3d/imagedisplay.h @@ -46,6 +46,7 @@ #include "qglmaterialcollection.h" #include <QString> +#include <QImage> QT_BEGIN_NAMESPACE class QGLBuilder; diff --git a/demos/qt3d/photobrowser3d/m5-photobrowser3d.desktop b/demos/qt3d/photobrowser3d/m5-photobrowser3d.desktop deleted file mode 100644 index 54efc5f88..000000000 --- a/demos/qt3d/photobrowser3d/m5-photobrowser3d.desktop +++ /dev/null @@ -1,14 +0,0 @@ -[Desktop Entry] -Encoding=UTF-8 -Version=1.0 -Name=Photobrowser -Comment=Qt3D example application -Exec=/usr/bin/photobrowser3d -fullscreen -Icon=icon-l-qt3d -Terminal=false -Type=Application -Categories=Development; -X-HildonDesk-ShowInToolbar=true -X-Osso-Type=application/x-executable -X-Text-Domain=qt3d - diff --git a/demos/qt3d/photobrowser3d/main.cpp b/demos/qt3d/photobrowser3d/main.cpp index 63886bc51..7537495a3 100644 --- a/demos/qt3d/photobrowser3d/main.cpp +++ b/demos/qt3d/photobrowser3d/main.cpp @@ -39,8 +39,8 @@ ** ****************************************************************************/ -#include <QtWidgets/QApplication> -#include <QtCore/QThread> +#include <QGuiApplication> +#include <QThread> #include "photobrowser3dview.h" @@ -48,7 +48,7 @@ int main(int argc, char *argv[]) { Q_INIT_RESOURCE(photobrowser3d); - QApplication app(argc, argv); + QGuiApplication app(argc, argv); // for QSettings QCoreApplication::setOrganizationName("Nokia"); diff --git a/demos/qt3d/photobrowser3d/photobrowser3d.desktop b/demos/qt3d/photobrowser3d/photobrowser3d.desktop deleted file mode 100644 index 747c80973..000000000 --- a/demos/qt3d/photobrowser3d/photobrowser3d.desktop +++ /dev/null @@ -1,8 +0,0 @@ -[Desktop Entry] -Type=Application -Name=Photobrowser 3D -Icon=icon-l-qt3d -Exec=/usr/bin/photobrowser3d -fullscreen -OnlyShowIn=X-MeeGo; -X-MeeGo-Logical-Id=qtn_comm_appname_photobrowser3d -X-MeeGo-Translation-Catalog=essentials diff --git a/demos/qt3d/photobrowser3d/photobrowser3d.pro b/demos/qt3d/photobrowser3d/photobrowser3d.pro index 37c7275f7..cf03b7605 100644 --- a/demos/qt3d/photobrowser3d/photobrowser3d.pro +++ b/demos/qt3d/photobrowser3d/photobrowser3d.pro @@ -1,10 +1,8 @@ TEMPLATE = app TARGET = photobrowser3d CONFIG += qt warn_on -QT += widgets -include(../../../pkg.pri) -QT += qt3d opengl +QT += qt3d SOURCES += main.cpp\ photobrowser3dview.cpp \ @@ -56,9 +54,6 @@ OTHER_FILES += \ shaders/replace_texture.fsh \ shaders/replace_texture.vsh -CONFIG += qt3d_deploy_pkg -include(../../../pkg.pri) - OTHER_FILES += \ photobrowser.rc diff --git a/demos/qt3d/photobrowser3d/photobrowser3dview.cpp b/demos/qt3d/photobrowser3d/photobrowser3dview.cpp index cee7d8817..25520bd5d 100644 --- a/demos/qt3d/photobrowser3d/photobrowser3dview.cpp +++ b/demos/qt3d/photobrowser3d/photobrowser3dview.cpp @@ -53,8 +53,7 @@ #include "pancontroller.h" #include "thumbnailnode.h" -#include <QApplication> -#include <QDesktopWidget> +#include <QGuiApplication> #include <QWheelEvent> #include <QDir> #include <QTimer> @@ -328,7 +327,7 @@ void PhotoBrowser3DView::waitForExit() } } -void PhotoBrowser3DView::closeEvent(QCloseEvent *e) +void PhotoBrowser3DView::hideEvent(QHideEvent *e) { if (m_images) { diff --git a/demos/qt3d/photobrowser3d/photobrowser3dview.h b/demos/qt3d/photobrowser3d/photobrowser3dview.h index f095ff708..0abd2ac62 100644 --- a/demos/qt3d/photobrowser3d/photobrowser3dview.h +++ b/demos/qt3d/photobrowser3d/photobrowser3dview.h @@ -79,7 +79,7 @@ protected: void resizeGL(int w, int h); void wheelEvent(QWheelEvent *e); void keyPressEvent(QKeyEvent *e); - void closeEvent(QCloseEvent *e); + void hideEvent(QHideEvent *e); void mousePressEvent(QMouseEvent *e); private slots: void initialise(); diff --git a/demos/qt3d/photobrowser3d/qatlas.cpp b/demos/qt3d/photobrowser3d/qatlas.cpp index d52a3cfe3..13a36b4ff 100644 --- a/demos/qt3d/photobrowser3d/qatlas.cpp +++ b/demos/qt3d/photobrowser3d/qatlas.cpp @@ -51,8 +51,8 @@ #include <QImage> #include <QThread> -#include <QGLFramebufferObject> -#include <QGLFramebufferObjectFormat> +#include <QOpenGLFramebufferObject> +#include <QOpenGLFramebufferObjectFormat> #include <QCoreApplication> #ifndef GL_MULTISAMPLE diff --git a/demos/qt3d/photobrowser3d/qatlas.h b/demos/qt3d/photobrowser3d/qatlas.h index f1bca7b2e..d5bec38f4 100644 --- a/demos/qt3d/photobrowser3d/qatlas.h +++ b/demos/qt3d/photobrowser3d/qatlas.h @@ -43,7 +43,8 @@ #define QATLAS_H #include <QSize> -#include <QtGui/QOpenGLFramebufferObject> +#include <QOpenGLFramebufferObject> +#include <QImage> #include "qarray.h" #include "qgeometrydata.h" @@ -53,7 +54,7 @@ class QAreaAllocator; class QGLTexture2D; class QGLMaterial; class QGeometryData; -class QGLFramebufferObject; +class QOpenGLFramebufferObject; class QGLFramebufferObjectSurface; QT_END_NAMESPACE diff --git a/demos/qt3d/photobrowser3d/thumbnaileffect.cpp b/demos/qt3d/photobrowser3d/thumbnaileffect.cpp index ab5c96d25..21a96fb1a 100644 --- a/demos/qt3d/photobrowser3d/thumbnaileffect.cpp +++ b/demos/qt3d/photobrowser3d/thumbnaileffect.cpp @@ -41,7 +41,7 @@ #include "thumbnaileffect.h" -#include <QtOpenGL/qglshaderprogram.h> +#include <QOpenGLShaderProgram> class ThumbnailEffectPrivate { @@ -56,7 +56,7 @@ public: } ~ThumbnailEffectPrivate() { delete program; } - QGLShaderProgram *program; + QOpenGLShaderProgram *program; int matrixUniform; int thumbnailUniform; int colorUniform; @@ -103,9 +103,9 @@ void ThumbnailEffect::setActive(QGLPainter *painter, bool flag) if (!d->program) { if (!flag) return; - d->program = new QGLShaderProgram(); - d->program->addShaderFromSourceFile(QGLShader::Vertex, ":/shaders/replace_texture.vsh"); - d->program->addShaderFromSourceFile(QGLShader::Fragment, ":/shaders/replace_texture.fsh"); + d->program = new QOpenGLShaderProgram(); + d->program->addShaderFromSourceFile(QOpenGLShader::Vertex, ":/shaders/replace_texture.vsh"); + d->program->addShaderFromSourceFile(QOpenGLShader::Fragment, ":/shaders/replace_texture.fsh"); d->program->bindAttributeLocation("vertex", QGL::Position); d->program->bindAttributeLocation("texcoord", QGL::TextureCoord0); d->program->bindAttributeLocation("thumbcoord", QGL::TextureCoord1); diff --git a/demos/qt3d/shapes/icon-l-qt3d.png b/demos/qt3d/shapes/icon-l-qt3d.png Binary files differdeleted file mode 100644 index 07cc4092d..000000000 --- a/demos/qt3d/shapes/icon-l-qt3d.png +++ /dev/null diff --git a/demos/qt3d/shapes/m5-shapes.desktop b/demos/qt3d/shapes/m5-shapes.desktop deleted file mode 100644 index e3ef575d7..000000000 --- a/demos/qt3d/shapes/m5-shapes.desktop +++ /dev/null @@ -1,14 +0,0 @@ -[Desktop Entry] -Encoding=UTF-8 -Version=1.0 -Name=Shapes -Comment=Qt3D example application -Exec=/usr/bin/shapes -fullscreen -Icon=icon-l-qt3d -Terminal=false -Type=Application -Categories=Development; -X-HildonDesk-ShowInToolbar=true -X-Osso-Type=application/x-executable -X-Text-Domain=qt3d - diff --git a/demos/qt3d/shapes/shapes.cpp b/demos/qt3d/shapes/shapes.cpp index 67c821ec3..ee73e42be 100644 --- a/demos/qt3d/shapes/shapes.cpp +++ b/demos/qt3d/shapes/shapes.cpp @@ -46,15 +46,16 @@ #include "qglcamera.h" #include "qgltexture2d.h" #include "qglsubsurface.h" -#include <QApplication> + +#include <QGuiApplication> #include <QImage> #include <QPainter> #include <QDebug> #include <QtGui/QFontDatabase> -#include <QtGui/QWindow> -#include <QtGui/QOpenGLContext> -#include <QtGui/QSurfaceFormat> +#include <QWindow> +#include <QOpenGLContext> +#include <QSurfaceFormat> class ShapesWidget : public QWindow { @@ -412,7 +413,7 @@ void ShapesWidget::paintTeapot(QGLPainter *painter, const QRect& rect) void ShapesWidget::drawText (QGLPainter *painter, const QRect& posn, const QString& str) { - QFont f = QApplication::font(); + QFont f = QGuiApplication::font(); QFontMetrics metrics(f); QRect rect = metrics.boundingRect(str); rect.adjust(0, 0, 1, 1); @@ -483,7 +484,7 @@ void ShapesWidget::ensureContext() int main(int argc, char *argv[]) { - QApplication app(argc, argv); + QGuiApplication app(argc, argv); ShapesWidget view; QStringList args = QCoreApplication::arguments(); diff --git a/demos/qt3d/shapes/shapes.desktop b/demos/qt3d/shapes/shapes.desktop deleted file mode 100644 index 7a841e128..000000000 --- a/demos/qt3d/shapes/shapes.desktop +++ /dev/null @@ -1,8 +0,0 @@ -[Desktop Entry] -Type=Application -Name=shapes -Icon=icon-l-qt3d -Exec=/usr/bin/shapes -fullscreen -OnlyShowIn=X-MeeGo; -X-MeeGo-Logical-Id=qtn_comm_appname_shapes -X-MeeGo-Translation-Catalog=essentials diff --git a/demos/qt3d/shapes/shapes.pro b/demos/qt3d/shapes/shapes.pro index bebc7157a..6453350d9 100644 --- a/demos/qt3d/shapes/shapes.pro +++ b/demos/qt3d/shapes/shapes.pro @@ -1,13 +1,10 @@ TEMPLATE = app TARGET = shapes CONFIG += qt warn_on -QT += widgets qt3d +QT += qt3d SOURCES = shapes.cpp -CONFIG += qt3d_deploy_pkg -include(../../../pkg.pri) - OTHER_FILES += \ shapes.rc diff --git a/demos/qt3d/teaservice/icon-l-qt3d.png b/demos/qt3d/teaservice/icon-l-qt3d.png Binary files differdeleted file mode 100644 index 07cc4092d..000000000 --- a/demos/qt3d/teaservice/icon-l-qt3d.png +++ /dev/null diff --git a/demos/qt3d/teaservice/m5-teaservice.desktop b/demos/qt3d/teaservice/m5-teaservice.desktop deleted file mode 100644 index be3e241a3..000000000 --- a/demos/qt3d/teaservice/m5-teaservice.desktop +++ /dev/null @@ -1,14 +0,0 @@ -[Desktop Entry] -Encoding=UTF-8 -Version=1.0 -Name=Tea Service -Comment=Qt3D example application -Exec=/usr/bin/teaservice -fullscreen -Icon=icon-l-qt3d -Terminal=false -Type=Application -Categories=Development; -X-HildonDesk-ShowInToolbar=true -X-Osso-Type=application/x-executable -X-Text-Domain=qt3d - diff --git a/demos/qt3d/teaservice/teaservice.cpp b/demos/qt3d/teaservice/teaservice.cpp index 9220cbec3..624de974c 100644 --- a/demos/qt3d/teaservice/teaservice.cpp +++ b/demos/qt3d/teaservice/teaservice.cpp @@ -39,14 +39,10 @@ ** ****************************************************************************/ -#include <QApplication> -#include <QMainWindow> -#include <QMenu> -#include <QMenuBar> +#include <QGuiApplication> #include <QKeyEvent> -#include <QAction> #include <QDebug> -#include <QtCore/QTimer> +#include <QTimer> #include "qglview.h" #include "meshobject.h" @@ -347,10 +343,10 @@ void TeaServiceView::keyPressEvent(QKeyEvent *e) int main(int argc, char *argv[]) { - QApplication app(argc, argv); + QGuiApplication app(argc, argv); TeaServiceView view; - QStringList args = QCoreApplication::arguments(); + QStringList args = QGuiApplication::arguments(); int w_pos = args.indexOf("-width"); int h_pos = args.indexOf("-height"); if (w_pos >= 0 && h_pos >= 0) diff --git a/demos/qt3d/teaservice/teaservice.desktop b/demos/qt3d/teaservice/teaservice.desktop deleted file mode 100644 index 2d49ae2f6..000000000 --- a/demos/qt3d/teaservice/teaservice.desktop +++ /dev/null @@ -1,8 +0,0 @@ -[Desktop Entry] -Type=Application -Name=Tea Service -Icon=icon-l-qt3d -Exec=/usr/bin/teaservice -fullscreen -OnlyShowIn=X-MeeGo; -X-MeeGo-Logical-Id=qtn_comm_appname_teaservice -X-MeeGo-Translation-Catalog=essentials diff --git a/demos/qt3d/teaservice/teaservice.pro b/demos/qt3d/teaservice/teaservice.pro index 650fe030e..c2a653106 100644 --- a/demos/qt3d/teaservice/teaservice.pro +++ b/demos/qt3d/teaservice/teaservice.pro @@ -1,18 +1,13 @@ TEMPLATE = app TARGET = teaservice CONFIG += qt warn_on -QT += widgets -include(../../../pkg.pri) QT += qt3d SOURCES = teaservice.cpp meshobject.cpp sceneobject.cpp perpixeleffect.cpp HEADERS = meshobject.h sceneobject.h perpixeleffect.h RESOURCES = teaservice.qrc -CONFIG += qt3d_deploy_pkg -include(../../../pkg.pri) - OTHER_FILES += \ teaservice.rc diff --git a/demos/quick3d/flickr3d/flickr3d.pro b/demos/quick3d/flickr3d/flickr3d.pro index 24303e947..e37c7456d 100644 --- a/demos/quick3d/flickr3d/flickr3d.pro +++ b/demos/quick3d/flickr3d/flickr3d.pro @@ -8,10 +8,6 @@ SOURCES += main.cpp INSTALL_DIRS = qml mt: INSTALL_FILES = mt.qml -CONFIG += qt3d_deploy_qml -include(../../../pkg.pri) -qtcAddDeployment() - OTHER_FILES += \ flickr3d.rc diff --git a/demos/quick3d/flickr3d/m5-robo_bounce.desktop b/demos/quick3d/flickr3d/m5-robo_bounce.desktop deleted file mode 100644 index 709103d57..000000000 --- a/demos/quick3d/flickr3d/m5-robo_bounce.desktop +++ /dev/null @@ -1,14 +0,0 @@ -[Desktop Entry] -Encoding=UTF-8 -Version=1.0 -Name=RoboBounce -Comment=Qt3D example application -Exec=/usr/bin/robo_bounce -fullscreen -Icon=icon-l-qtquick3d -Terminal=false -Type=Application -Categories=Development; -X-HildonDesk-ShowInToolbar=true -X-Osso-Type=application/x-executable -X-Text-Domain=qt3d - diff --git a/demos/quick3d/model_viewer/icon-l-qtquick3d.png b/demos/quick3d/model_viewer/icon-l-qtquick3d.png Binary files differdeleted file mode 100644 index 69deef3f6..000000000 --- a/demos/quick3d/model_viewer/icon-l-qtquick3d.png +++ /dev/null diff --git a/demos/quick3d/model_viewer/m5-model_viewer.desktop b/demos/quick3d/model_viewer/m5-model_viewer.desktop deleted file mode 100644 index 10a860f7f..000000000 --- a/demos/quick3d/model_viewer/m5-model_viewer.desktop +++ /dev/null @@ -1,14 +0,0 @@ -[Desktop Entry] -Encoding=UTF-8 -Version=1.0 -Name=Model Viewer -Comment=Qt3D example application -Exec=/usr/bin/model_viewer -fullscreen -Icon=icon-l-qtquick3d -Terminal=false -Type=Application -Categories=Development; -X-HildonDesk-ShowInToolbar=true -X-Osso-Type=application/x-executable -X-Text-Domain=qt3d - diff --git a/demos/quick3d/model_viewer/model_viewer.desktop b/demos/quick3d/model_viewer/model_viewer.desktop deleted file mode 100644 index a89b4f09e..000000000 --- a/demos/quick3d/model_viewer/model_viewer.desktop +++ /dev/null @@ -1,8 +0,0 @@ -[Desktop Entry] -Type=Application -Name=Model Viewer -Icon=icon-l-qtquick3d -Exec=/usr/bin/model_viewer -fullscreen -OnlyShowIn=X-MeeGo; -X-MeeGo-Logical-Id=qtn_comm_appname_model_viewer -X-MeeGo-Translation-Catalog=essentials diff --git a/demos/quick3d/model_viewer/model_viewer.pro b/demos/quick3d/model_viewer/model_viewer.pro index 1f80e89e2..09d362805 100644 --- a/demos/quick3d/model_viewer/model_viewer.pro +++ b/demos/quick3d/model_viewer/model_viewer.pro @@ -1,6 +1,6 @@ TEMPLATE = app TARGET = model_viewer -QT += declarative quick widgets +QT += declarative quick CONFIG += qt warn_on SOURCES += main.cpp @@ -8,10 +8,6 @@ SOURCES += main.cpp INSTALL_DIRS = qml mt: INSTALL_FILES = mt.qml -CONFIG += qt3d_deploy_qml -include(../../../pkg.pri) -qtcAddDeployment() - OTHER_FILES += \ model_viewer.rc diff --git a/demos/quick3d/robo_bounce/icon-l-qtquick3d.png b/demos/quick3d/robo_bounce/icon-l-qtquick3d.png Binary files differdeleted file mode 100644 index 69deef3f6..000000000 --- a/demos/quick3d/robo_bounce/icon-l-qtquick3d.png +++ /dev/null diff --git a/demos/quick3d/robo_bounce/m5-robo_bounce.desktop b/demos/quick3d/robo_bounce/m5-robo_bounce.desktop deleted file mode 100644 index 709103d57..000000000 --- a/demos/quick3d/robo_bounce/m5-robo_bounce.desktop +++ /dev/null @@ -1,14 +0,0 @@ -[Desktop Entry] -Encoding=UTF-8 -Version=1.0 -Name=RoboBounce -Comment=Qt3D example application -Exec=/usr/bin/robo_bounce -fullscreen -Icon=icon-l-qtquick3d -Terminal=false -Type=Application -Categories=Development; -X-HildonDesk-ShowInToolbar=true -X-Osso-Type=application/x-executable -X-Text-Domain=qt3d - diff --git a/demos/quick3d/robo_bounce/robo_bounce.desktop b/demos/quick3d/robo_bounce/robo_bounce.desktop deleted file mode 100644 index a143dccff..000000000 --- a/demos/quick3d/robo_bounce/robo_bounce.desktop +++ /dev/null @@ -1,8 +0,0 @@ -[Desktop Entry] -Type=Application -Name=RoboBounce -Icon=icon-l-qtquick3d -Exec=/usr/bin/robo_bounce -fullscreen -OnlyShowIn=X-MeeGo; -X-MeeGo-Logical-Id=qtn_comm_appname_robo_bounce -X-MeeGo-Translation-Catalog=essentials diff --git a/demos/quick3d/robo_bounce/robo_bounce.pro b/demos/quick3d/robo_bounce/robo_bounce.pro index 1b5fc63a5..34e219ef6 100644 --- a/demos/quick3d/robo_bounce/robo_bounce.pro +++ b/demos/quick3d/robo_bounce/robo_bounce.pro @@ -7,10 +7,6 @@ SOURCES += main.cpp INSTALL_DIRS = qml mt: INSTALL_FILES = mt.qml -CONFIG += qt3d_deploy_qml -include(../../../pkg.pri) -qtcAddDeployment() - OTHER_FILES += \ robo_bounce.rc diff --git a/demos/quick3d/tea_service/icon-l-qtquick3d.png b/demos/quick3d/tea_service/icon-l-qtquick3d.png Binary files differdeleted file mode 100644 index 69deef3f6..000000000 --- a/demos/quick3d/tea_service/icon-l-qtquick3d.png +++ /dev/null diff --git a/demos/quick3d/tea_service/m5-tea_service.desktop b/demos/quick3d/tea_service/m5-tea_service.desktop deleted file mode 100644 index 5281703e7..000000000 --- a/demos/quick3d/tea_service/m5-tea_service.desktop +++ /dev/null @@ -1,14 +0,0 @@ -[Desktop Entry] -Encoding=UTF-8 -Version=1.0 -Name=Tea Service -Comment=Qt3D example application -Exec=/usr/bin/tea_service -fullscreen -Icon=icon-l-qtquick3d -Terminal=false -Type=Application -Categories=Development; -X-HildonDesk-ShowInToolbar=true -X-Osso-Type=application/x-executable -X-Text-Domain=qt3d - diff --git a/demos/quick3d/tea_service/tea_service.desktop b/demos/quick3d/tea_service/tea_service.desktop deleted file mode 100644 index de9814edb..000000000 --- a/demos/quick3d/tea_service/tea_service.desktop +++ /dev/null @@ -1,8 +0,0 @@ -[Desktop Entry] -Type=Application -Name=Tea Service -Icon=icon-l-qtquick3d -Exec=/usr/bin/tea_service -fullscreen -OnlyShowIn=X-MeeGo; -X-MeeGo-Logical-Id=qtn_comm_appname_tea_service -X-MeeGo-Translation-Catalog=essentials diff --git a/demos/quick3d/tea_service/tea_service.pro b/demos/quick3d/tea_service/tea_service.pro index cd84bebd7..1baead31d 100644 --- a/demos/quick3d/tea_service/tea_service.pro +++ b/demos/quick3d/tea_service/tea_service.pro @@ -1,6 +1,6 @@ TEMPLATE = app TARGET = tea_service -QT += declarative quick widgets +QT += declarative quick CONFIG += qt warn_on SOURCES += main.cpp @@ -8,10 +8,6 @@ SOURCES += main.cpp INSTALL_DIRS = qml mt: INSTALL_FILES = mt.qml -CONFIG += qt3d_deploy_qml -include(../../../pkg.pri) -qtcAddDeployment() - OTHER_FILES += \ tea_service.rc diff --git a/examples/qt3d/basket/basket.desktop b/examples/qt3d/basket/basket.desktop deleted file mode 100644 index c64ec3dc9..000000000 --- a/examples/qt3d/basket/basket.desktop +++ /dev/null @@ -1,8 +0,0 @@ -[Desktop Entry] -Type=Application -Name=Basket -Icon=icon-l-qt3d -Exec=/usr/bin/basket -fullscreen -OnlyShowIn=X-MeeGo; -X-MeeGo-Logical-Id=qtn_comm_appname_basket -X-MeeGo-Translation-Catalog=essentials diff --git a/examples/qt3d/basket/basket.pro b/examples/qt3d/basket/basket.pro index 03d6370b7..4dc471c68 100644 --- a/examples/qt3d/basket/basket.pro +++ b/examples/qt3d/basket/basket.pro @@ -3,9 +3,6 @@ TARGET = basket CONFIG += qt warn_on QT += qt3d -CONFIG += qt3d_deploy_pkg -include(../../../pkg.pri) - SOURCES = basketview.cpp main.cpp HEADERS = basketview.h basket_data.h RESOURCES = basket.qrc diff --git a/examples/qt3d/basket/icon-l-qt3d.png b/examples/qt3d/basket/icon-l-qt3d.png Binary files differdeleted file mode 100644 index 07cc4092d..000000000 --- a/examples/qt3d/basket/icon-l-qt3d.png +++ /dev/null diff --git a/examples/qt3d/basket/m5-basket.desktop b/examples/qt3d/basket/m5-basket.desktop deleted file mode 100644 index b2dff71ab..000000000 --- a/examples/qt3d/basket/m5-basket.desktop +++ /dev/null @@ -1,14 +0,0 @@ -[Desktop Entry] -Encoding=UTF-8 -Version=1.0 -Name=Basket -Comment=Qt3D example application -Exec=/usr/bin/basket -fullscreen -Icon=icon-l-qt3d -Terminal=false -Type=Application -Categories=Development; -X-HildonDesk-ShowInToolbar=true -X-Osso-Type=application/x-executable -X-Text-Domain=qt3d - diff --git a/examples/qt3d/builder/builder.desktop b/examples/qt3d/builder/builder.desktop deleted file mode 100644 index 3cae4d977..000000000 --- a/examples/qt3d/builder/builder.desktop +++ /dev/null @@ -1,8 +0,0 @@ -[Desktop Entry] -Type=Application -Name=Builder -Icon=icon-l-qt3d -Exec=/usr/bin/builder -fullscreen -OnlyShowIn=X-MeeGo; -X-MeeGo-Logical-Id=qtn_comm_appname_builder -X-MeeGo-Translation-Catalog=essentials diff --git a/examples/qt3d/builder/builder.pro b/examples/qt3d/builder/builder.pro index f16480aea..a92561a3d 100644 --- a/examples/qt3d/builder/builder.pro +++ b/examples/qt3d/builder/builder.pro @@ -2,16 +2,13 @@ TEMPLATE = app TARGET = builder CONFIG += qt warn_on -QT += widgets qt3d +QT += qt3d SOURCES = builder.cpp \ main.cpp HEADERS = builder.h RESOURCES += builder.qrc -CONFIG += qt3d_deploy_pkg -include(../../../pkg.pri) - OTHER_FILES += \ builder.rc diff --git a/examples/qt3d/builder/icon-l-qt3d.png b/examples/qt3d/builder/icon-l-qt3d.png Binary files differdeleted file mode 100644 index 07cc4092d..000000000 --- a/examples/qt3d/builder/icon-l-qt3d.png +++ /dev/null diff --git a/examples/qt3d/builder/m5-builder.desktop b/examples/qt3d/builder/m5-builder.desktop deleted file mode 100644 index 1c87f8ab3..000000000 --- a/examples/qt3d/builder/m5-builder.desktop +++ /dev/null @@ -1,14 +0,0 @@ -[Desktop Entry] -Encoding=UTF-8 -Version=1.0 -Name=Builder -Comment=Qt3D example application -Exec=/usr/bin/builder -fullscreen -Icon=icon-l-qt3d -Terminal=false -Type=Application -Categories=Development; -X-HildonDesk-ShowInToolbar=true -X-Osso-Type=application/x-executable -X-Text-Domain=qt3d - diff --git a/examples/qt3d/builder/main.cpp b/examples/qt3d/builder/main.cpp index 7bae0038f..f0705c0c2 100644 --- a/examples/qt3d/builder/main.cpp +++ b/examples/qt3d/builder/main.cpp @@ -38,13 +38,13 @@ ** ****************************************************************************/ -#include <QApplication> +#include <QGuiApplication> #include "builder.h" int main(int argc, char *argv[]) { - QApplication app(argc, argv); + QGuiApplication app(argc, argv); BuilderView view; if (view.stereoType() != QGLView::RedCyanAnaglyph) diff --git a/examples/qt3d/cube/cube.desktop b/examples/qt3d/cube/cube.desktop deleted file mode 100644 index 8f26f5d6f..000000000 --- a/examples/qt3d/cube/cube.desktop +++ /dev/null @@ -1,8 +0,0 @@ -[Desktop Entry] -Type=Application -Name=cube Qt3D -Icon=icon-l-qt3d -Exec=/usr/bin/cube -fullscreen -OnlyShowIn=X-MeeGo; -X-MeeGo-Logical-Id=qtn_comm_appname_cube -X-MeeGo-Translation-Catalog=essentials diff --git a/examples/qt3d/cube/cube.pro b/examples/qt3d/cube/cube.pro index 5a80109d3..821f3e9da 100644 --- a/examples/qt3d/cube/cube.pro +++ b/examples/qt3d/cube/cube.pro @@ -1,15 +1,12 @@ TEMPLATE = app TARGET = cube CONFIG += qt warn_on -QT += widgets qt3d +QT += qt3d SOURCES = cubeview.cpp main.cpp HEADERS = cubeview.h RESOURCES = cube.qrc -CONFIG += qt3d_deploy_pkg -include(../../../pkg.pri) - OTHER_FILES += \ cube.rc diff --git a/examples/qt3d/cube/icon-l-qt3d.png b/examples/qt3d/cube/icon-l-qt3d.png Binary files differdeleted file mode 100644 index 07cc4092d..000000000 --- a/examples/qt3d/cube/icon-l-qt3d.png +++ /dev/null diff --git a/examples/qt3d/cube/m5-cube.desktop b/examples/qt3d/cube/m5-cube.desktop deleted file mode 100644 index 5fcc35fdf..000000000 --- a/examples/qt3d/cube/m5-cube.desktop +++ /dev/null @@ -1,14 +0,0 @@ -[Desktop Entry] -Encoding=UTF-8 -Version=1.0 -Name=Cube -Comment=Qt3D example application -Exec=/usr/bin/cube -fullscreen -Icon=icon-l-qt3d -Terminal=false -Type=Application -Categories=Development; -X-HildonDesk-ShowInToolbar=true -X-Osso-Type=application/x-executable -X-Text-Domain=qt3d - diff --git a/examples/qt3d/cube/main.cpp b/examples/qt3d/cube/main.cpp index d4c44d7d0..f95ea8b27 100644 --- a/examples/qt3d/cube/main.cpp +++ b/examples/qt3d/cube/main.cpp @@ -38,12 +38,13 @@ ** ****************************************************************************/ -#include <QApplication> +#include <QGuiApplication> + #include "cubeview.h" int main(int argc, char *argv[]) { - QApplication app(argc, argv); + QGuiApplication app(argc, argv); CubeView view; if (view.stereoType() != QGLView::RedCyanAnaglyph) diff --git a/examples/qt3d/cylinder/cylinder.desktop b/examples/qt3d/cylinder/cylinder.desktop deleted file mode 100644 index 49f7198a6..000000000 --- a/examples/qt3d/cylinder/cylinder.desktop +++ /dev/null @@ -1,8 +0,0 @@ -[Desktop Entry] -Type=Application -Name=Cappucino -Icon=icon-l-qt3d -Exec=/usr/bin/cylinder -fullscreen -OnlyShowIn=X-MeeGo; -X-MeeGo-Logical-Id=qtn_comm_appname_cylinder -X-MeeGo-Translation-Catalog=essentials diff --git a/examples/qt3d/cylinder/cylinder.pro b/examples/qt3d/cylinder/cylinder.pro index b557ae878..d69470e25 100644 --- a/examples/qt3d/cylinder/cylinder.pro +++ b/examples/qt3d/cylinder/cylinder.pro @@ -1,15 +1,12 @@ TEMPLATE = app TARGET = cylinder CONFIG += qt warn_on -QT += widgets qt3d +QT += qt3d SOURCES = cylinderview.cpp main.cpp HEADERS = cylinderview.h RESOURCES = cylinder.qrc -CONFIG += qt3d_deploy_pkg -include(../../../pkg.pri) - OTHER_FILES += \ cylinder.rc diff --git a/examples/qt3d/cylinder/icon-l-qt3d.png b/examples/qt3d/cylinder/icon-l-qt3d.png Binary files differdeleted file mode 100644 index 07cc4092d..000000000 --- a/examples/qt3d/cylinder/icon-l-qt3d.png +++ /dev/null diff --git a/examples/qt3d/cylinder/m5-cylinder.desktop b/examples/qt3d/cylinder/m5-cylinder.desktop deleted file mode 100644 index 6edf612fa..000000000 --- a/examples/qt3d/cylinder/m5-cylinder.desktop +++ /dev/null @@ -1,14 +0,0 @@ -[Desktop Entry] -Encoding=UTF-8 -Version=1.0 -Name=Cappucino -Comment=Qt3D example application -Exec=/usr/bin/cylinder -fullscreen -Icon=icon-l-qt3d -Terminal=false -Type=Application -Categories=Development; -X-HildonDesk-ShowInToolbar=true -X-Osso-Type=application/x-executable -X-Text-Domain=qt3d - diff --git a/examples/qt3d/cylinder/main.cpp b/examples/qt3d/cylinder/main.cpp index 27ffd1739..cd968949c 100644 --- a/examples/qt3d/cylinder/main.cpp +++ b/examples/qt3d/cylinder/main.cpp @@ -38,12 +38,13 @@ ** ****************************************************************************/ -#include <QApplication> +#include <QGuiApplication> + #include "cylinderview.h" int main(int argc, char *argv[]) { - QApplication app(argc, argv); + QGuiApplication app(argc, argv); CylinderView view; if (view.stereoType() != QGLView::RedCyanAnaglyph) diff --git a/examples/qt3d/geometry/geometry.desktop b/examples/qt3d/geometry/geometry.desktop deleted file mode 100644 index 12fb440b3..000000000 --- a/examples/qt3d/geometry/geometry.desktop +++ /dev/null @@ -1,8 +0,0 @@ -[Desktop Entry] -Type=Application -Name=D20 Qt3D -Icon=icon-l-qt3d -Exec=/usr/bin/geometry -fullscreen -OnlyShowIn=X-MeeGo; -X-MeeGo-Logical-Id=qtn_comm_appname_geometry -X-MeeGo-Translation-Catalog=essentials diff --git a/examples/qt3d/geometry/geometry.pro b/examples/qt3d/geometry/geometry.pro index 401baeec9..204a77268 100644 --- a/examples/qt3d/geometry/geometry.pro +++ b/examples/qt3d/geometry/geometry.pro @@ -1,7 +1,7 @@ TEMPLATE = app TARGET = geometry CONFIG += qt warn_on -QT += widgets qt3d +QT += qt3d SOURCES = geometryview.cpp \ main.cpp \ @@ -12,9 +12,6 @@ HEADERS = geometryview.h \ quadplane.h RESOURCES = geometry.qrc -CONFIG += qt3d_deploy_pkg -include(../../../pkg.pri) - OTHER_FILES += \ geometry.rc diff --git a/examples/qt3d/geometry/icon-l-qt3d.png b/examples/qt3d/geometry/icon-l-qt3d.png Binary files differdeleted file mode 100644 index 07cc4092d..000000000 --- a/examples/qt3d/geometry/icon-l-qt3d.png +++ /dev/null diff --git a/examples/qt3d/geometry/m5-geometry.desktop b/examples/qt3d/geometry/m5-geometry.desktop deleted file mode 100644 index 486deff15..000000000 --- a/examples/qt3d/geometry/m5-geometry.desktop +++ /dev/null @@ -1,14 +0,0 @@ -[Desktop Entry] -Encoding=UTF-8 -Version=1.0 -Name=D20 Qt3D -Comment=Qt3D example application -Exec=/usr/bin/geometry -fullscreen -Icon=icon-l-qt3d -Terminal=false -Type=Application -Categories=Development; -X-HildonDesk-ShowInToolbar=true -X-Osso-Type=application/x-executable -X-Text-Domain=qt3d - diff --git a/examples/qt3d/geometry/main.cpp b/examples/qt3d/geometry/main.cpp index 1a073130c..78c3d4a24 100644 --- a/examples/qt3d/geometry/main.cpp +++ b/examples/qt3d/geometry/main.cpp @@ -38,12 +38,13 @@ ** ****************************************************************************/ -#include <QApplication> +#include <QGuiApplication> + #include "geometryview.h" int main(int argc, char *argv[]) { - QApplication app(argc, argv); + QGuiApplication app(argc, argv); GeometryView view; if (view.stereoType() != QGLView::RedCyanAnaglyph) diff --git a/examples/qt3d/graphicsview/graphicsview.desktop b/examples/qt3d/graphicsview/graphicsview.desktop deleted file mode 100644 index 8c460a67b..000000000 --- a/examples/qt3d/graphicsview/graphicsview.desktop +++ /dev/null @@ -1,8 +0,0 @@ -[Desktop Entry] -Type=Application -Name=GraphicsView -Icon=icon-l-qt3d -Exec=/usr/bin/graphicsview -fullscreen -OnlyShowIn=X-MeeGo; -X-MeeGo-Logical-Id=qtn_comm_appname_graphicsview -X-MeeGo-Translation-Catalog=essentials diff --git a/examples/qt3d/graphicsview/graphicsview.pro b/examples/qt3d/graphicsview/graphicsview.pro index 452e9fdde..a8ba2f1ba 100644 --- a/examples/qt3d/graphicsview/graphicsview.pro +++ b/examples/qt3d/graphicsview/graphicsview.pro @@ -1,7 +1,7 @@ TEMPLATE = app TARGET = graphicsview CONFIG += qt warn_on -QT += widgets qt3d +QT += qt3d VPATH += $$PWD/../../src/threed/geometry SOURCES = \ @@ -26,9 +26,6 @@ HEADERS = \ RESOURCES = \ graphicsview.qrc -CONFIG += qt3d_deploy_pkg -include(../../../pkg.pri) - OTHER_FILES += \ graphicsview.rc diff --git a/examples/qt3d/graphicsview/icon-l-qt3d.png b/examples/qt3d/graphicsview/icon-l-qt3d.png Binary files differdeleted file mode 100644 index 07cc4092d..000000000 --- a/examples/qt3d/graphicsview/icon-l-qt3d.png +++ /dev/null diff --git a/examples/qt3d/graphicsview/m5-graphicsview.desktop b/examples/qt3d/graphicsview/m5-graphicsview.desktop deleted file mode 100644 index 2667da450..000000000 --- a/examples/qt3d/graphicsview/m5-graphicsview.desktop +++ /dev/null @@ -1,14 +0,0 @@ -[Desktop Entry] -Encoding=UTF-8 -Version=1.0 -Name=GraphicsView -Comment=Qt3D example application -Exec=/usr/bin/graphicsview -fullscreen -Icon=icon-l-qt3d -Terminal=false -Type=Application -Categories=Development; -X-HildonDesk-ShowInToolbar=true -X-Osso-Type=application/x-executable -X-Text-Domain=qt3d - diff --git a/examples/qt3d/graphicsview/main.cpp b/examples/qt3d/graphicsview/main.cpp index 2405111f2..d45f4b37b 100644 --- a/examples/qt3d/graphicsview/main.cpp +++ b/examples/qt3d/graphicsview/main.cpp @@ -39,9 +39,7 @@ ****************************************************************************/ #include <QApplication> -#include <QtOpenGL/qgl.h> -#include <QtCore/qmath.h> -#include <QtCore/qdatetime.h> + #include "view.h" int main(int argc, char *argv[]) diff --git a/examples/qt3d/nesting/icon-l-qt3d.png b/examples/qt3d/nesting/icon-l-qt3d.png Binary files differdeleted file mode 100644 index 07cc4092d..000000000 --- a/examples/qt3d/nesting/icon-l-qt3d.png +++ /dev/null diff --git a/examples/qt3d/nesting/m5-nesting.desktop b/examples/qt3d/nesting/m5-nesting.desktop deleted file mode 100644 index a81022e0b..000000000 --- a/examples/qt3d/nesting/m5-nesting.desktop +++ /dev/null @@ -1,14 +0,0 @@ -[Desktop Entry] -Encoding=UTF-8 -Version=1.0 -Name=Nesting -Comment=Qt3D example application -Exec=/usr/bin/nesting -fullscreen -Icon=icon-l-qt3d -Terminal=false -Type=Application -Categories=Development; -X-HildonDesk-ShowInToolbar=true -X-Osso-Type=application/x-executable -X-Text-Domain=qt3d - diff --git a/examples/qt3d/nesting/main.cpp b/examples/qt3d/nesting/main.cpp index da1a26198..844aa5ca5 100644 --- a/examples/qt3d/nesting/main.cpp +++ b/examples/qt3d/nesting/main.cpp @@ -38,12 +38,13 @@ ** ****************************************************************************/ -#include <QApplication> +#include <QGuiApplication> + #include "cubeview.h" int main(int argc, char *argv[]) { - QApplication app(argc, argv); + QGuiApplication app(argc, argv); CubeView view; QStringList args = QCoreApplication::arguments(); diff --git a/examples/qt3d/nesting/nesting.desktop b/examples/qt3d/nesting/nesting.desktop deleted file mode 100644 index 59eff4577..000000000 --- a/examples/qt3d/nesting/nesting.desktop +++ /dev/null @@ -1,8 +0,0 @@ -[Desktop Entry] -Type=Application -Name=Nesting -Icon=icon-l-qt3d -Exec=/usr/bin/nesting -fullscreen -OnlyShowIn=X-MeeGo; -X-MeeGo-Logical-Id=qtn_comm_appname_nesting -X-MeeGo-Translation-Catalog=essentials diff --git a/examples/qt3d/nesting/nesting.pro b/examples/qt3d/nesting/nesting.pro index 1fdae9a49..8cdcecaf7 100644 --- a/examples/qt3d/nesting/nesting.pro +++ b/examples/qt3d/nesting/nesting.pro @@ -1,15 +1,12 @@ TEMPLATE = app TARGET = nesting CONFIG += qt warn_on -QT += widgets qt3d +QT += qt3d SOURCES = cubeview.cpp main.cpp HEADERS = cubeview.h RESOURCES = nesting.qrc -CONFIG += qt3d_deploy_pkg -include(../../../pkg.pri) - OTHER_FILES += \ nesting.rc diff --git a/examples/qt3d/qt3d.pro b/examples/qt3d/qt3d.pro index 07b7c8dc6..24139f4b9 100644 --- a/examples/qt3d/qt3d.pro +++ b/examples/qt3d/qt3d.pro @@ -1,2 +1,4 @@ TEMPLATE = subdirs -SUBDIRS += basket builder cube cylinder geometry graphicsview nesting solarsystem tank teapot +SUBDIRS += basket builder cube cylinder geometry nesting solarsystem tank teapot + +contains(QT_CONFIG, opengl): contains(QT_CONFIG, widgets): SUBDIRS += graphicsview diff --git a/examples/qt3d/solarsystem/icon-l-qt3d.png b/examples/qt3d/solarsystem/icon-l-qt3d.png Binary files differdeleted file mode 100644 index 07cc4092d..000000000 --- a/examples/qt3d/solarsystem/icon-l-qt3d.png +++ /dev/null diff --git a/examples/qt3d/solarsystem/m5-solarsystem.desktop b/examples/qt3d/solarsystem/m5-solarsystem.desktop deleted file mode 100644 index b2dff71ab..000000000 --- a/examples/qt3d/solarsystem/m5-solarsystem.desktop +++ /dev/null @@ -1,14 +0,0 @@ -[Desktop Entry] -Encoding=UTF-8 -Version=1.0 -Name=Basket -Comment=Qt3D example application -Exec=/usr/bin/basket -fullscreen -Icon=icon-l-qt3d -Terminal=false -Type=Application -Categories=Development; -X-HildonDesk-ShowInToolbar=true -X-Osso-Type=application/x-executable -X-Text-Domain=qt3d - diff --git a/examples/qt3d/solarsystem/main.cpp b/examples/qt3d/solarsystem/main.cpp index eb64b07c9..fa6e118e6 100644 --- a/examples/qt3d/solarsystem/main.cpp +++ b/examples/qt3d/solarsystem/main.cpp @@ -38,13 +38,13 @@ ** ****************************************************************************/ -#include <QApplication> +#include <QGuiApplication> #include "solarsystem.h" int main(int argc, char *argv[]) { - QApplication app(argc, argv); + QGuiApplication app(argc, argv); SolarSystemView view; QStringList args = QCoreApplication::arguments(); diff --git a/examples/qt3d/solarsystem/solarsystem.cpp b/examples/qt3d/solarsystem/solarsystem.cpp index c411dc669..70b649552 100644 --- a/examples/qt3d/solarsystem/solarsystem.cpp +++ b/examples/qt3d/solarsystem/solarsystem.cpp @@ -38,7 +38,6 @@ ** ****************************************************************************/ -#include <QPropertyAnimation> #include "solarsystem.h" #include "qglbuilder.h" #include "qglmaterialcollection.h" @@ -50,11 +49,11 @@ #include "qgraphicsrotation3d.h" #include "qgraphicstranslation3d.h" #include "qglshaderprogrameffect.h" -#include "qglshaderprogram.h" - -#include <QtGui/qmatrix4x4.h> -#include <QtCore/qmath.h> +#include <QPropertyAnimation> +#include <QOpenGLShaderProgram> +#include <QMatrix4x4> +#include <qmath.h> SolarSystemView::SolarSystemView(QWindow *parent) : QGLView(parent) diff --git a/examples/qt3d/solarsystem/solarsystem.desktop b/examples/qt3d/solarsystem/solarsystem.desktop deleted file mode 100644 index c64ec3dc9..000000000 --- a/examples/qt3d/solarsystem/solarsystem.desktop +++ /dev/null @@ -1,8 +0,0 @@ -[Desktop Entry] -Type=Application -Name=Basket -Icon=icon-l-qt3d -Exec=/usr/bin/basket -fullscreen -OnlyShowIn=X-MeeGo; -X-MeeGo-Logical-Id=qtn_comm_appname_basket -X-MeeGo-Translation-Catalog=essentials diff --git a/examples/qt3d/solarsystem/solarsystem.pro b/examples/qt3d/solarsystem/solarsystem.pro index e14b3fe43..344cc82a4 100644 --- a/examples/qt3d/solarsystem/solarsystem.pro +++ b/examples/qt3d/solarsystem/solarsystem.pro @@ -1,7 +1,7 @@ TEMPLATE = app TARGET = solarsystem CONFIG += qt warn_on -QT += widgets qt3d +QT += qt3d SOURCES = solarsystem.cpp \ main.cpp @@ -9,9 +9,6 @@ HEADERS = solarsystem.h RESOURCES += solarsystem.qrc DEPENDPATH += resources -CONFIG += qt3d_deploy_pkg -include(../../../pkg.pri) - OTHER_FILES += \ resources/moon-texture.jpg \ resources/planet.jpg \ diff --git a/examples/qt3d/tank/icon-l-qt3d.png b/examples/qt3d/tank/icon-l-qt3d.png Binary files differdeleted file mode 100644 index 07cc4092d..000000000 --- a/examples/qt3d/tank/icon-l-qt3d.png +++ /dev/null diff --git a/examples/qt3d/tank/m5-tank.desktop b/examples/qt3d/tank/m5-tank.desktop deleted file mode 100644 index ec6dfe0ed..000000000 --- a/examples/qt3d/tank/m5-tank.desktop +++ /dev/null @@ -1,14 +0,0 @@ -[Desktop Entry] -Encoding=UTF-8 -Version=1.0 -Name=Tank -Comment=Qt3D example application -Exec=/usr/bin/tank -fullscreen -Icon=icon-l-qt3d -Terminal=false -Type=Application -Categories=Development; -X-HildonDesk-ShowInToolbar=true -X-Osso-Type=application/x-executable -X-Text-Domain=qt3d - diff --git a/examples/qt3d/tank/main.cpp b/examples/qt3d/tank/main.cpp index 763327fc1..97f628496 100644 --- a/examples/qt3d/tank/main.cpp +++ b/examples/qt3d/tank/main.cpp @@ -38,7 +38,7 @@ ** ****************************************************************************/ -#include <QtWidgets/QApplication> +#include <QGuiApplication> #include <time.h> @@ -48,7 +48,7 @@ int main(int argc, char *argv[]) { qsrand(time(0)); - QApplication a(argc, argv); + QGuiApplication a(argc, argv); TankView view; if (view.stereoType() != QGLView::RedCyanAnaglyph) diff --git a/examples/qt3d/tank/quadplane.cpp b/examples/qt3d/tank/quadplane.cpp index 1ac1e5e52..91c303910 100644 --- a/examples/qt3d/tank/quadplane.cpp +++ b/examples/qt3d/tank/quadplane.cpp @@ -41,6 +41,9 @@ #include "quadplane.h" #include "qgraphicsrotation3d.h" +#include <QImage> +#include <QPainter> + QGLMaterial *qCreateFloor() { quint32 sz = 512; diff --git a/examples/qt3d/tank/tank.desktop b/examples/qt3d/tank/tank.desktop deleted file mode 100644 index e9636e175..000000000 --- a/examples/qt3d/tank/tank.desktop +++ /dev/null @@ -1,8 +0,0 @@ -[Desktop Entry] -Type=Application -Name=Tank -Icon=icon-l-qt3d -Exec=/usr/bin/tank -fullscreen -OnlyShowIn=X-MeeGo; -X-MeeGo-Logical-Id=qtn_comm_appname_tank -X-MeeGo-Translation-Catalog=essentials diff --git a/examples/qt3d/tank/tank.pro b/examples/qt3d/tank/tank.pro index a7d639c67..d82489d5a 100644 --- a/examples/qt3d/tank/tank.pro +++ b/examples/qt3d/tank/tank.pro @@ -1,7 +1,7 @@ TARGET = tank TEMPLATE = app CONFIG += qt warn_on -QT += widgets qt3d +QT += qt3d SOURCES += main.cpp\ tankview.cpp \ @@ -12,9 +12,6 @@ HEADERS += tankview.h \ tank.h \ quadplane.h -CONFIG += qt3d_deploy_pkg -include(../../../pkg.pri) - OTHER_FILES += \ tank.rc diff --git a/examples/qt3d/teapot/icon-l-qt3d.png b/examples/qt3d/teapot/icon-l-qt3d.png Binary files differdeleted file mode 100644 index 07cc4092d..000000000 --- a/examples/qt3d/teapot/icon-l-qt3d.png +++ /dev/null diff --git a/examples/qt3d/teapot/m5-teapot.desktop b/examples/qt3d/teapot/m5-teapot.desktop deleted file mode 100644 index 091cc63b1..000000000 --- a/examples/qt3d/teapot/m5-teapot.desktop +++ /dev/null @@ -1,14 +0,0 @@ -[Desktop Entry] -Encoding=UTF-8 -Version=1.0 -Name=Teapot -Comment=Qt3D example application -Exec=/usr/bin/teapot -fullscreen -Icon=icon-l-qt3d -Terminal=false -Type=Application -Categories=Development; -X-HildonDesk-ShowInToolbar=true -X-Osso-Type=application/x-executable -X-Text-Domain=qt3d - diff --git a/examples/qt3d/teapot/main.cpp b/examples/qt3d/teapot/main.cpp index be7221829..aef883d60 100644 --- a/examples/qt3d/teapot/main.cpp +++ b/examples/qt3d/teapot/main.cpp @@ -38,13 +38,14 @@ ** ****************************************************************************/ -#include <QApplication> +#include <QGuiApplication> + #include "teapotview.h" //! [main] int main(int argc, char *argv[]) { - QApplication app(argc, argv); + QGuiApplication app(argc, argv); TeapotView view; //! [main-args] diff --git a/examples/qt3d/teapot/teapot.desktop b/examples/qt3d/teapot/teapot.desktop deleted file mode 100644 index 264fe1a92..000000000 --- a/examples/qt3d/teapot/teapot.desktop +++ /dev/null @@ -1,8 +0,0 @@ -[Desktop Entry] -Type=Application -Name=teapot Qt3D -Icon=icon-l-qt3d -Exec=/usr/bin/teapot -fullscreen -OnlyShowIn=X-MeeGo; -X-MeeGo-Logical-Id=qtn_comm_appname_teapot -X-MeeGo-Translation-Catalog=essentials diff --git a/examples/qt3d/teapot/teapot.pro b/examples/qt3d/teapot/teapot.pro index f8930978f..6ef036f7c 100644 --- a/examples/qt3d/teapot/teapot.pro +++ b/examples/qt3d/teapot/teapot.pro @@ -1,14 +1,11 @@ TEMPLATE = app TARGET = teapot CONFIG += qt warn_on -QT += widgets qt3d +QT += qt3d SOURCES = teapotview.cpp main.cpp HEADERS = teapotview.h -CONFIG += qt3d_deploy_pkg -include(../../../pkg.pri) - OTHER_FILES += \ teapot.rc diff --git a/examples/quick3d/basket/basket.pro b/examples/quick3d/basket/basket.pro index 4815e883d..316da6812 100644 --- a/examples/quick3d/basket/basket.pro +++ b/examples/quick3d/basket/basket.pro @@ -8,10 +8,6 @@ SOURCES += main.cpp INSTALL_DIRS = qml mt: INSTALL_FILES = mt.qml -CONFIG += qt3d_deploy_qml -include(../../../pkg.pri) -qtcAddDeployment() - OTHER_FILES += \ basket_qml.rc diff --git a/examples/quick3d/basket/basket_qml.desktop b/examples/quick3d/basket/basket_qml.desktop deleted file mode 100644 index 1fb9f1e04..000000000 --- a/examples/quick3d/basket/basket_qml.desktop +++ /dev/null @@ -1,8 +0,0 @@ -[Desktop Entry] -Type=Application -Name=Basket -Icon=icon-l-qtquick3d -Exec=/usr/bin/basket_qml -fullscreen -OnlyShowIn=X-MeeGo; -X-MeeGo-Logical-Id=qtn_comm_appname_basket_qml -X-MeeGo-Translation-Catalog=essentials diff --git a/examples/quick3d/basket/icon-l-qtquick3d.png b/examples/quick3d/basket/icon-l-qtquick3d.png Binary files differdeleted file mode 100644 index 69deef3f6..000000000 --- a/examples/quick3d/basket/icon-l-qtquick3d.png +++ /dev/null diff --git a/examples/quick3d/basket/m5-basket_qml.desktop b/examples/quick3d/basket/m5-basket_qml.desktop deleted file mode 100644 index f153f5f82..000000000 --- a/examples/quick3d/basket/m5-basket_qml.desktop +++ /dev/null @@ -1,14 +0,0 @@ -[Desktop Entry] -Encoding=UTF-8 -Version=1.0 -Name=Basket -Comment=Qt3D example application -Exec=/usr/bin/basket_qml -fullscreen -Icon=icon-l-qtquick3d -Terminal=false -Type=Application -Categories=Development; -X-HildonDesk-ShowInToolbar=true -X-Osso-Type=application/x-executable -X-Text-Domain=qt3d - diff --git a/examples/quick3d/cube/cube.desktop b/examples/quick3d/cube/cube.desktop deleted file mode 100644 index e28b8fa27..000000000 --- a/examples/quick3d/cube/cube.desktop +++ /dev/null @@ -1,8 +0,0 @@ -[Desktop Entry] -Type=Application -Name=Cube -Icon=icon-l-qtquick3d -Exec=/usr/bin/cube -fullscreen -OnlyShowIn=X-MeeGo; -X-MeeGo-Logical-Id=qtn_comm_appname_cube -X-MeeGo-Translation-Catalog=essentials diff --git a/examples/quick3d/cube/cube.pro b/examples/quick3d/cube/cube.pro index eb48b9984..6f595466a 100644 --- a/examples/quick3d/cube/cube.pro +++ b/examples/quick3d/cube/cube.pro @@ -8,10 +8,6 @@ SOURCES += main.cpp INSTALL_DIRS = qml mt: INSTALL_FILES = mt.qml -CONFIG += qt3d_deploy_qml -include(../../../pkg.pri) -qtcAddDeployment() - OTHER_FILES += \ cube_qml.rc diff --git a/examples/quick3d/cube/icon-l-qtquick3d.png b/examples/quick3d/cube/icon-l-qtquick3d.png Binary files differdeleted file mode 100644 index 69deef3f6..000000000 --- a/examples/quick3d/cube/icon-l-qtquick3d.png +++ /dev/null diff --git a/examples/quick3d/cube/m5-cube.desktop b/examples/quick3d/cube/m5-cube.desktop deleted file mode 100644 index 8974fc02d..000000000 --- a/examples/quick3d/cube/m5-cube.desktop +++ /dev/null @@ -1,14 +0,0 @@ -[Desktop Entry] -Encoding=UTF-8 -Version=1.0 -Name=Cube -Comment=Qt3D example application -Exec=/usr/bin/cube -fullscreen -Icon=icon-l-qtquick3d -Terminal=false -Type=Application -Categories=Development; -X-HildonDesk-ShowInToolbar=true -X-Osso-Type=application/x-executable -X-Text-Domain=qt3d - diff --git a/examples/quick3d/forest/forest.desktop b/examples/quick3d/forest/forest.desktop deleted file mode 100644 index fc5054da1..000000000 --- a/examples/quick3d/forest/forest.desktop +++ /dev/null @@ -1,8 +0,0 @@ -[Desktop Entry] -Type=Application -Name=Forest -Icon=icon-l-qtquick3d -Exec=/usr/bin/forest -fullscreen -OnlyShowIn=X-MeeGo; -X-MeeGo-Logical-Id=qtn_comm_appname_forest -X-MeeGo-Translation-Catalog=essentials diff --git a/examples/quick3d/forest/forest.pro b/examples/quick3d/forest/forest.pro index 297f94db5..600d19983 100644 --- a/examples/quick3d/forest/forest.pro +++ b/examples/quick3d/forest/forest.pro @@ -8,10 +8,6 @@ SOURCES += main.cpp INSTALL_DIRS = qml mt: INSTALL_FILES = mt.qml -CONFIG += qt3d_deploy_qml -include(../../../pkg.pri) -qtcAddDeployment() - OTHER_FILES += \ forest.rc diff --git a/examples/quick3d/forest/icon-l-qtquick3d.png b/examples/quick3d/forest/icon-l-qtquick3d.png Binary files differdeleted file mode 100644 index 69deef3f6..000000000 --- a/examples/quick3d/forest/icon-l-qtquick3d.png +++ /dev/null diff --git a/examples/quick3d/forest/m5-forest.desktop b/examples/quick3d/forest/m5-forest.desktop deleted file mode 100644 index 7cefea228..000000000 --- a/examples/quick3d/forest/m5-forest.desktop +++ /dev/null @@ -1,14 +0,0 @@ -[Desktop Entry] -Encoding=UTF-8 -Version=1.0 -Name=Forest -Comment=Qt3D example application -Exec=/usr/bin/forest -fullscreen -Icon=icon-l-qtquick3d -Terminal=false -Type=Application -Categories=Development; -X-HildonDesk-ShowInToolbar=true -X-Osso-Type=application/x-executable -X-Text-Domain=qt3d - diff --git a/examples/quick3d/lander/icon-l-qtquick3d.png b/examples/quick3d/lander/icon-l-qtquick3d.png Binary files differdeleted file mode 100644 index 69deef3f6..000000000 --- a/examples/quick3d/lander/icon-l-qtquick3d.png +++ /dev/null diff --git a/examples/quick3d/lander/lander.desktop b/examples/quick3d/lander/lander.desktop deleted file mode 100644 index 09241e0ec..000000000 --- a/examples/quick3d/lander/lander.desktop +++ /dev/null @@ -1,8 +0,0 @@ -[Desktop Entry] -Type=Application -Name=Lunar Lander -Icon=icon-l-qtquick3d -Exec=/usr/bin/lander -fullscreen -OnlyShowIn=X-MeeGo; -X-MeeGo-Logical-Id=qtn_comm_appname_lander -X-MeeGo-Translation-Catalog=essentials diff --git a/examples/quick3d/lander/lander.pro b/examples/quick3d/lander/lander.pro index 76c4fa707..6da2af8d8 100644 --- a/examples/quick3d/lander/lander.pro +++ b/examples/quick3d/lander/lander.pro @@ -8,10 +8,6 @@ SOURCES += main.cpp INSTALL_DIRS = qml mt: INSTALL_FILES = mt.qml -CONFIG += qt3d_deploy_qml -include(../../../pkg.pri) -qtcAddDeployment() - OTHER_FILES += \ lander.rc diff --git a/examples/quick3d/lander/m5-lander.desktop b/examples/quick3d/lander/m5-lander.desktop deleted file mode 100644 index 5fd0b564d..000000000 --- a/examples/quick3d/lander/m5-lander.desktop +++ /dev/null @@ -1,14 +0,0 @@ -[Desktop Entry] -Encoding=UTF-8 -Version=1.0 -Name=Lunar Lander -Comment=Qt3D example application -Exec=/usr/bin/lander -fullscreen -Icon=icon-l-qtquick3d -Terminal=false -Type=Application -Categories=Development; -X-HildonDesk-ShowInToolbar=true -X-Osso-Type=application/x-executable -X-Text-Domain=qt3d - diff --git a/examples/quick3d/matrix_animation/icon-l-qtquick3d.png b/examples/quick3d/matrix_animation/icon-l-qtquick3d.png Binary files differdeleted file mode 100644 index 69deef3f6..000000000 --- a/examples/quick3d/matrix_animation/icon-l-qtquick3d.png +++ /dev/null diff --git a/examples/quick3d/matrix_animation/m5-matrix_animation.desktop b/examples/quick3d/matrix_animation/m5-matrix_animation.desktop deleted file mode 100644 index 757b853a9..000000000 --- a/examples/quick3d/matrix_animation/m5-matrix_animation.desktop +++ /dev/null @@ -1,14 +0,0 @@ -[Desktop Entry] -Encoding=UTF-8 -Version=1.0 -Name=Matrix -Comment=Qt3D example application -Exec=/usr/bin/matrix_animation -fullscreen -Icon=icon-l-qtquick3d -Terminal=false -Type=Application -Categories=Development; -X-HildonDesk-ShowInToolbar=true -X-Osso-Type=application/x-executable -X-Text-Domain=qt3d - diff --git a/examples/quick3d/matrix_animation/matrix_animation.desktop b/examples/quick3d/matrix_animation/matrix_animation.desktop deleted file mode 100644 index 6ece282f7..000000000 --- a/examples/quick3d/matrix_animation/matrix_animation.desktop +++ /dev/null @@ -1,8 +0,0 @@ -[Desktop Entry] -Type=Application -Name=Matrix -Icon=icon-l-qtquick3d -Exec=/usr/bin/matrix_animation -fullscreen -OnlyShowIn=X-MeeGo; -X-MeeGo-Logical-Id=qtn_comm_appname_matrix_animation -X-MeeGo-Translation-Catalog=essentials diff --git a/examples/quick3d/matrix_animation/matrix_animation.pro b/examples/quick3d/matrix_animation/matrix_animation.pro index 891566e19..0011f89fc 100644 --- a/examples/quick3d/matrix_animation/matrix_animation.pro +++ b/examples/quick3d/matrix_animation/matrix_animation.pro @@ -8,10 +8,6 @@ SOURCES += main.cpp INSTALL_DIRS = qml mt: INSTALL_FILES = mt.qml -CONFIG += qt3d_deploy_qml -include(../../../pkg.pri) -qtcAddDeployment() - OTHER_FILES += \ matrix_animation.rc diff --git a/examples/quick3d/monkeygod/icon-l-qtquick3d.png b/examples/quick3d/monkeygod/icon-l-qtquick3d.png Binary files differdeleted file mode 100644 index 69deef3f6..000000000 --- a/examples/quick3d/monkeygod/icon-l-qtquick3d.png +++ /dev/null diff --git a/examples/quick3d/monkeygod/m5-monkeygod.desktop b/examples/quick3d/monkeygod/m5-monkeygod.desktop deleted file mode 100644 index 8093862c3..000000000 --- a/examples/quick3d/monkeygod/m5-monkeygod.desktop +++ /dev/null @@ -1,14 +0,0 @@ -[Desktop Entry] -Encoding=UTF-8 -Version=1.0 -Name=Monkeygod -Comment=Qt3D example application -Exec=/usr/bin/monkeygod -fullscreen -Icon=icon-l-qtquick3d -Terminal=false -Type=Application -Categories=Development; -X-HildonDesk-ShowInToolbar=true -X-Osso-Type=application/x-executable -X-Text-Domain=qt3d - diff --git a/examples/quick3d/monkeygod/monkeygod.desktop b/examples/quick3d/monkeygod/monkeygod.desktop deleted file mode 100644 index dd646cfbc..000000000 --- a/examples/quick3d/monkeygod/monkeygod.desktop +++ /dev/null @@ -1,8 +0,0 @@ -[Desktop Entry] -Type=Application -Name=monkeygod -Icon=icon-l-qtquick3d -Exec=/usr/bin/monkeygod -fullscreen -OnlyShowIn=X-MeeGo; -X-MeeGo-Logical-Id=qtn_comm_appname_monkeygod -X-MeeGo-Translation-Catalog=essentials diff --git a/examples/quick3d/monkeygod/monkeygod.pro b/examples/quick3d/monkeygod/monkeygod.pro index 030277d18..59c279b36 100644 --- a/examples/quick3d/monkeygod/monkeygod.pro +++ b/examples/quick3d/monkeygod/monkeygod.pro @@ -5,14 +5,27 @@ QT += declarative quick SOURCES += main.cpp -INSTALL_DIRS = qml -mt: INSTALL_FILES = mt.qml +ICON_FILE = ../icon.png -CONFIG += qt3d_deploy_qml +QML_FILES = \ + qml/desktop.qml \ + qml/Monkeygod.qml \ + qml/Penguin.qml + +QML_INFRA_FILES = \ + $$QML_FILES \ + qml/marble.png + +QML_MESHES_FILES = \ + qml/meshes/monkey.3ds \ + qml/meshes/penguin.3ds + +CATEGORY = examples include(../../../pkg.pri) -qtcAddDeployment() OTHER_FILES += \ + mt.qml \ + $$QML_INFRA_FILES \ monkeygod.rc RC_FILE = monkeygod.rc diff --git a/examples/quick3d/moon/icon-l-qtquick3d.png b/examples/quick3d/moon/icon-l-qtquick3d.png Binary files differdeleted file mode 100644 index 69deef3f6..000000000 --- a/examples/quick3d/moon/icon-l-qtquick3d.png +++ /dev/null diff --git a/examples/quick3d/moon/m5-moon.desktop b/examples/quick3d/moon/m5-moon.desktop deleted file mode 100644 index e642416af..000000000 --- a/examples/quick3d/moon/m5-moon.desktop +++ /dev/null @@ -1,14 +0,0 @@ -[Desktop Entry] -Encoding=UTF-8 -Version=1.0 -Name=Moon -Comment=Qt3D example application -Exec=/usr/bin/moon -fullscreen -Icon=icon-l-qtquick3d -Terminal=false -Type=Application -Categories=Development; -X-HildonDesk-ShowInToolbar=true -X-Osso-Type=application/x-executable -X-Text-Domain=qt3d - diff --git a/examples/quick3d/moon/moon.desktop b/examples/quick3d/moon/moon.desktop deleted file mode 100644 index 14e498d58..000000000 --- a/examples/quick3d/moon/moon.desktop +++ /dev/null @@ -1,8 +0,0 @@ -[Desktop Entry] -Type=Application -Name=Moon -Icon=icon-l-qtquick3d -Exec=/usr/bin/moon -fullscreen -OnlyShowIn=X-MeeGo; -X-MeeGo-Logical-Id=qtn_comm_appname_moon -X-MeeGo-Translation-Catalog=essentials diff --git a/examples/quick3d/moon/moon.pro b/examples/quick3d/moon/moon.pro index 8e7d05c9e..7a505768b 100644 --- a/examples/quick3d/moon/moon.pro +++ b/examples/quick3d/moon/moon.pro @@ -8,10 +8,6 @@ SOURCES += main.cpp INSTALL_DIRS = qml mt: INSTALL_FILES = mt.qml -CONFIG += qt3d_deploy_qml -include(../../../pkg.pri) -qtcAddDeployment() - OTHER_FILES += \ moon.rc diff --git a/examples/quick3d/photoroom/icon-l-qtquick3d.png b/examples/quick3d/photoroom/icon-l-qtquick3d.png Binary files differdeleted file mode 100644 index 69deef3f6..000000000 --- a/examples/quick3d/photoroom/icon-l-qtquick3d.png +++ /dev/null diff --git a/examples/quick3d/photoroom/m5-photoroom.desktop b/examples/quick3d/photoroom/m5-photoroom.desktop deleted file mode 100644 index 9fc7a8cbf..000000000 --- a/examples/quick3d/photoroom/m5-photoroom.desktop +++ /dev/null @@ -1,14 +0,0 @@ -[Desktop Entry] -Encoding=UTF-8 -Version=1.0 -Name=PhotoRoom -Comment=Qt3D example application -Exec=/usr/bin/photoroom -fullscreen -Icon=icon-l-qtquick3d -Terminal=false -Type=Application -Categories=Development; -X-HildonDesk-ShowInToolbar=true -X-Osso-Type=application/x-executable -X-Text-Domain=qt3d - diff --git a/examples/quick3d/photoroom/photoroom.desktop b/examples/quick3d/photoroom/photoroom.desktop deleted file mode 100644 index 65624b3d0..000000000 --- a/examples/quick3d/photoroom/photoroom.desktop +++ /dev/null @@ -1,8 +0,0 @@ -[Desktop Entry] -Type=Application -Name=PhotoRoom -Icon=icon-l-qtquick3d -Exec=/usr/bin/photoroom -fullscreen -OnlyShowIn=X-MeeGo; -X-MeeGo-Logical-Id=qtn_comm_appname_photoroom -X-MeeGo-Translation-Catalog=essentials diff --git a/examples/quick3d/photoroom/photoroom.pro b/examples/quick3d/photoroom/photoroom.pro index 0d1fbcd1c..e5f65d221 100644 --- a/examples/quick3d/photoroom/photoroom.pro +++ b/examples/quick3d/photoroom/photoroom.pro @@ -8,10 +8,6 @@ SOURCES += main.cpp INSTALL_DIRS = qml mt: INSTALL_FILES = mt.qml -CONFIG += qt3d_deploy_qml -include(../../../pkg.pri) -qtcAddDeployment() - OTHER_FILES += \ photoroom.rc diff --git a/examples/quick3d/shaders/icon-l-qtquick3d.png b/examples/quick3d/shaders/icon-l-qtquick3d.png Binary files differdeleted file mode 100644 index 69deef3f6..000000000 --- a/examples/quick3d/shaders/icon-l-qtquick3d.png +++ /dev/null diff --git a/examples/quick3d/shaders/m5-shaders.desktop b/examples/quick3d/shaders/m5-shaders.desktop deleted file mode 100644 index cb868a746..000000000 --- a/examples/quick3d/shaders/m5-shaders.desktop +++ /dev/null @@ -1,14 +0,0 @@ -[Desktop Entry] -Encoding=UTF-8 -Version=1.0 -Name=Shaders -Comment=Qt3D example application -Exec=/usr/bin/shaders -fullscreen -Icon=icon-l-qtquick3d -Terminal=false -Type=Application -Categories=Development; -X-HildonDesk-ShowInToolbar=true -X-Osso-Type=application/x-executable -X-Text-Domain=qt3d - diff --git a/examples/quick3d/shaders/shaders.desktop b/examples/quick3d/shaders/shaders.desktop deleted file mode 100644 index d5663e398..000000000 --- a/examples/quick3d/shaders/shaders.desktop +++ /dev/null @@ -1,8 +0,0 @@ -[Desktop Entry] -Type=Application -Name=Shaders -Icon=icon-l-qtquick3d -Exec=/usr/bin/shaders -fullscreen -OnlyShowIn=X-MeeGo; -X-MeeGo-Logical-Id=qtn_comm_appname_shaders -X-MeeGo-Translation-Catalog=essentials diff --git a/examples/quick3d/shaders/shaders.pro b/examples/quick3d/shaders/shaders.pro index 56d628ed8..11ec4d51c 100644 --- a/examples/quick3d/shaders/shaders.pro +++ b/examples/quick3d/shaders/shaders.pro @@ -8,10 +8,6 @@ SOURCES += main.cpp INSTALL_DIRS = qml mt: INSTALL_FILES = mt.qml -CONFIG += qt3d_deploy_qml -include(../../../pkg.pri) -qtcAddDeployment() - OTHER_FILES += \ shaders.rc diff --git a/examples/quick3d/sphere/icon-l-qtquick3d.png b/examples/quick3d/sphere/icon-l-qtquick3d.png Binary files differdeleted file mode 100644 index 69deef3f6..000000000 --- a/examples/quick3d/sphere/icon-l-qtquick3d.png +++ /dev/null diff --git a/examples/quick3d/sphere/m5-sphere.desktop b/examples/quick3d/sphere/m5-sphere.desktop deleted file mode 100644 index 00f391ed5..000000000 --- a/examples/quick3d/sphere/m5-sphere.desktop +++ /dev/null @@ -1,14 +0,0 @@ -[Desktop Entry] -Encoding=UTF-8 -Version=1.0 -Name=Sphere -Comment=Qt3D example application -Exec=/usr/bin/sphere -fullscreen -Icon=icon-l-qtquick3d -Terminal=false -Type=Application -Categories=Development; -X-HildonDesk-ShowInToolbar=true -X-Osso-Type=application/x-executable -X-Text-Domain=qt3d - diff --git a/examples/quick3d/sphere/sphere.desktop b/examples/quick3d/sphere/sphere.desktop deleted file mode 100644 index de9c2951f..000000000 --- a/examples/quick3d/sphere/sphere.desktop +++ /dev/null @@ -1,8 +0,0 @@ -[Desktop Entry] -Type=Application -Name=Sphere -Icon=icon-l-qtquick3d -Exec=/usr/bin/sphere -fullscreen -OnlyShowIn=X-MeeGo; -X-MeeGo-Logical-Id=qtn_comm_appname_sphere -X-MeeGo-Translation-Catalog=essentials diff --git a/examples/quick3d/sphere/sphere.pro b/examples/quick3d/sphere/sphere.pro index faf72d9e5..92d85980d 100644 --- a/examples/quick3d/sphere/sphere.pro +++ b/examples/quick3d/sphere/sphere.pro @@ -8,10 +8,6 @@ SOURCES += main.cpp INSTALL_DIRS = qml mt: INSTALL_FILES = mt.qml -CONFIG += qt3d_deploy_qml -include(../../../pkg.pri) -qtcAddDeployment() - OTHER_FILES += \ sphere.rc diff --git a/modules/qt_qt3d.pri b/modules/qt_qt3d.pri index 8e4e74602..f3c733bb2 100644 --- a/modules/qt_qt3d.pri +++ b/modules/qt_qt3d.pri @@ -11,7 +11,7 @@ QT.qt3d.sources = $$QT_MODULE_BASE/src/threed QT.qt3d.libs = $$QT_MODULE_LIB_BASE QT.qt3d.plugins = $$QT_MODULE_PLUGIN_BASE QT.qt3d.imports = $$QT_MODULE_IMPORT_BASE -QT.qt3d.depends = gui opengl +QT.qt3d.depends = gui QT.qt3d.DEFINES = QT_QT3D_LIB QT_CONFIG += qt3d diff --git a/modules/qt_qt3dquick.pri b/modules/qt_qt3dquick.pri index c7155e9b7..375d809c8 100644 --- a/modules/qt_qt3dquick.pri +++ b/modules/qt_qt3dquick.pri @@ -11,7 +11,7 @@ QT.qt3dquick.sources = $$QT_MODULE_BASE/src/quick3d QT.qt3dquick.libs = $$QT_MODULE_LIB_BASE QT.qt3dquick.plugins = $$QT_MODULE_PLUGIN_BASE QT.qt3dquick.imports = $$QT_MODULE_IMPORT_BASE -QT.qt3dquick.depends = gui opengl declarative quick network +QT.qt3dquick.depends = gui quick declarative network QT.qt3dquick.DEFINES = QT_QT3DQUICK_LIB QT_CONFIG += qt3dquick @@ -1,275 +1,70 @@ -# Config for making example and demo apps packageable - -# Note that the paths here all assumed the including .pro file -# is exactly 3 levels of directory tree below the root - -qtc_harmattan { - CONFIG += maemo - CONFIG += package - QMAKE_CXXFLAGS += -Wno-psabi - # The Qt SDK / Qt Creator harmattan integration needs some special treatment - QT3D_INSTALL_BINS = /bin - QT3D_INSTALL_LIBS = /usr/lib - QT3D_INSTALL_PLUGINS = /usr/lib/qt4/plugins - QT3D_INSTALL_IMPORTS = /usr/lib/qt4/imports - QT3D_INSTALL_DATA = /usr/share/qt4 -} else { - QT3D_INSTALL_BINS = $$[QT_INSTALL_BINS] - QT3D_INSTALL_LIBS = $$[QT_INSTALL_LIBS] - QT3D_INSTALL_PLUGINS = $$[QT_INSTALL_PLUGINS] - QT3D_INSTALL_IMPORTS = $$[QT_INSTALL_IMPORTS] - QT3D_INSTALL_DATA = $$[QT_INSTALL_DATA] +mt { + desktopfile.files = $${TARGET}.qmlproject info.json + desktopfile.path = /opt/mt/applications/$$TARGET + icon.files = $$ICON_FILE + icon.path = /opt/mt/applications/$$TARGET + INSTALLS += desktopfile icon } -qt3dquick_deploy_pkg { - CONFIG += qt3d_deploy_pkg +!package: DESTDIR = ../../../bin +!isEmpty(QML_INFRA_FILES) { + # rules to copy files from the *base level* of $$PWD/qml into the right place package { - macx:CONFIG(qt_framework, qt_framework|qt_no_framework) { - LIBS += -framework Qt3DQuick -F../../../src/quick3d - INCLUDEPATH += ../../../src/quick3d/Qt3DQuick.framework/Versions/1/Headers + copyqmlinfra_install.files = $$QML_INFRA_FILES + mt { + copyqmlwrap.files = mt.qml + copyqmlwrap.path = /opt/mt/applications/$$TARGET + INSTALLS += copyqmlwrap + copyqmlinfra_install.path = /opt/mt/applications/$$TARGET/qml } else { - win32 { - CONFIG(debug, debug|release) { - TARGET = $$member(TARGET, 0)d - LIBS += ..\\..\\..\\src\\quick3d\\debug\\Qt3DQuickd.lib - } else { - LIBS += ..\\..\\..\\src\\quick3d\\release\\Qt3DQuick.lib - } + macx { + copyqmlinfra_install.path = $$DESTDIR/$${TARGET}.app/Contents/Resources/qml } else { - LIBS += -L../../../src/quick3d -lQt3DQuick + copyqmlinfra_install.path = $$DESTDIR/resources/$$CATEGORY/$${TARGET}/qml } - INCLUDEPATH += ../../../include/Qt3DQuick } - QT += declarative quick opengl - - maemo: icons.files = icon-l-qtquick3d.png + INSTALLS += copyqmlinfra_install } else { - CONFIG += qt3dquick - } -} - -qt3d_deploy_pkg { - package { - macx:CONFIG(qt_framework, qt_framework|qt_no_framework) { - LIBS += -framework Qt3D -F../../../src/threed - INCLUDEPATH += ../../../src/threed/Qt3D.framework/Versions/1/Headers + macx { + target_dir = $$DESTDIR/$${TARGET}.app/Contents/Resources/qml } else { - win32 { - CONFIG(debug, debug|release) { - TARGET = $$member(TARGET, 0)d - LIBS += ..\\..\\..\\src\\threed\\debug\\Qt3Dd.lib - } else { - LIBS += ..\\..\\..\\src\\threed\\release\\Qt3D.lib - } - } else { - LIBS += -L../../../src/threed -lQt3D - } - INCLUDEPATH += ../../../include/Qt3D + target_dir = $$DESTDIR/resources/$$CATEGORY/$${TARGET}/qml } - QT += opengl - - !qt3dquick_deploy_pkg: maemo: icons.files = icon-l-qt3d.png - } else { - CONFIG += qt3d + copyqmlinfra.input = QML_INFRA_FILES + copyqmlinfra.output = $$target_dir/${QMAKE_FILE_IN_BASE}${QMAKE_FILE_EXT} + copyqmlinfra.commands = $(MKDIR) $$target_dir && $$QMAKE_COPY ${QMAKE_FILE_IN} ${QMAKE_FILE_OUT} + copyqmlinfra.CONFIG += no_link_no_clean + copyqmlinfra.variable_out = POST_TARGETDEPS + QMAKE_EXTRA_COMPILERS += copyqmlinfra } } -contains(TEMPLATE, app) { - package { - maemo { - applnk.files = $${TARGET}.desktop - applnk.path = /usr/share/applications - - # icons.files is set by qt3dquick_pkg_dep.pri or qt3d_pkg_dep.pri - icons.path = /usr/share/themes/base/meegotouch/icons - INSTALLS += icons applnk - - app_target.path = $$QT3D_INSTALL_BINS - INSTALLS += app_target +!isEmpty(QML_MESHES_FILES) { + # rules to copy files from the *base level* of $$PWD/qml/meshes into the right place + package { + copyqmlmeshes_install.files = $$QML_MESHES_FILES + mt { + copyqmlmeshes_install.path = /opt/mt/applications/$$TARGET/qml/meshes } else { - mt { - applnk.files = info.json $${TARGET}.qmlproject - applnk.path = /opt/mt/applications/$${TARGET} - - # icons.files is set by qt3dquick_pkg_dep.pri or qt3d_pkg_dep.pri - icons.path = /opt/mt/applications/$${TARGET} - INSTALLS += icons applnk - app_target.path = /opt/mt/applications/$${TARGET} - INSTALLS += app_target - - DEFINES += QT3D_USE_OPT=$${TARGET} + macx { + copyqmlmeshes_install.path = $$DESTDIR/$${TARGET}.app/Contents/Resources/qml/meshes } else { - app_target.path = $$QT3D_INSTALL_BINS - INSTALLS += app_target + copyqmlmeshes_install.path = $$DESTDIR/resources/$$CATEGORY/$${TARGET}/qml/meshes } } + INSTALLS += copyqmlmeshes_install } else { - DESTDIR = ../../../bin - } -} - -qt3d_deploy_qml { - mt { - package { - TARGET_DIR = $$PWD - } else { - TARGET_DIR = /opt/mt/applications/$$TARGET - } - } else { - TARGET_DIR = $$[QT_INSTALL_DATA]/quick3d/resources/examples/$$TARGET - } - symbian { - TARGET_DIR = . - } else: macx { - TARGET_DIR = . - } else { - !package { - TARGET_DIR = ../../../bin/resources/examples/$$TARGET - } - } - for(dir, INSTALL_DIRS) { - di.source = $${dir} - di.target = $$TARGET_DIR - DEPLOYMENTFOLDERS += di - } - for(file, INSTALL_FILES) { - fi.source = $${file} - fi.target = $$TARGET_DIR - DEPLOYMENTFOLDERS += fi - } -} - -# The following code was generated by the Qt Quick Application wizard of Qt Creator. -# The file it was contained in was qmlapplicationviewer.pri, if necessary it should -# be possible to simply cut & paste the code straight out of the latest version to -# update it. -# -# The only changes has been to comment out the installPrexfix line below, this -# will probably be necessary to replicate when replacing. -# -defineTest(qtcAddDeployment) { - MAINPROFILEPWD = $$PWD - - win32 { - copyCommand = - !package { - for(deploymentfolder, DEPLOYMENTFOLDERS) { - source = $$MAINPROFILEPWD/$$eval($${deploymentfolder}.source) - source = $$replace(source, /, \\) - sourcePathSegments = $$split(source, \\) - target = $$OUT_PWD/$$eval($${deploymentfolder}.target)/$$last(sourcePathSegments) - target = $$replace(target, /, \\) - !isEqual(source,$$target) { - !isEmpty(copyCommand):copyCommand += && - isEqual(QMAKE_DIR_SEP, \\) { - copyCommand += $$QMAKE_COPY_DIR \"$$source\" \"$$target\" - } else { - source = $$replace(source, \\\\, /) - target = $$OUT_PWD/$$eval($${deploymentfolder}.target) - target = $$replace(target, \\\\, /) - copyCommand += test -d \"$$target\" || mkdir -p \"$$target\" && cp -r \"$$source\" \"$$target\" - } - } - } - !isEmpty(copyCommand) { - message(copyCommand - $$copyCommand) - copyCommand = @echo Copying application data... && $$copyCommand - copydeploymentfolders.commands = $$copyCommand - first.depends = $(first) copydeploymentfolders - export(first.depends) - export(copydeploymentfolders.commands) - QMAKE_EXTRA_TARGETS += first copydeploymentfolders - } - } - for(deploymentfolder, DEPLOYMENTFOLDERS) { - item = item$${deploymentfolder} - itemfiles = $${item}.files - $$itemfiles = $$eval($${deploymentfolder}.source) - itempath = $${item}.path - $$itempath = $$eval($${deploymentfolder}.target) - export($$itemfiles) - export($$itempath) - INSTALLS += $$item - } - } else:unix { - maemo5 { - desktopfile.files = $${TARGET}.desktop - desktopfile.path = /usr/share/applications/hildon - icon.files = $${TARGET}64.png - icon.path = /usr/share/icons/hicolor/64x64/apps + macx { + target_dir = $$DESTDIR/$${TARGET}.app/Contents/Resources/qml/meshes } else { - desktopfile.files = $${TARGET}_harmattan.desktop - desktopfile.path = /usr/share/applications - icon.files = $${TARGET}80.png - icon.path = /usr/share/icons/hicolor/80x80/apps - copyCommand = - for(deploymentfolder, DEPLOYMENTFOLDERS) { - source = $$MAINPROFILEPWD/$$eval($${deploymentfolder}.source) - source = $$replace(source, \\\\, /) - macx { - target = $$DESTDIR/$${TARGET}.app/Contents/Resources/$$eval($${deploymentfolder}.target) - } else { - target = $$OUT_PWD/$$eval($${deploymentfolder}.target) - } - target = $$replace(target, \\\\, /) - sourcePathSegments = $$split(source, /) - targetFullPath = $$target/$$last(sourcePathSegments) - !isEqual(source,$$targetFullPath) { - !isEmpty(copyCommand):copyCommand += && - copyCommand += $(MKDIR) \"$$target\" - copyCommand += && $(COPY_DIR) -v \"$$source\" \"$$target\" - } - } - !isEmpty(copyCommand) { - copyCommand = @echo Copying application data... && $$copyCommand - copydeploymentfolders.commands = $$copyCommand - first.depends = $(first) copydeploymentfolders - export(first.depends) - export(copydeploymentfolders.commands) - QMAKE_EXTRA_TARGETS += first copydeploymentfolders - } + target_dir = $$DESTDIR/resources/$$CATEGORY/$${TARGET}/qml/meshes } - mt { - desktopfile.files = $${TARGET}.qmlproject info.json - desktopfile.path = /opt/mt/applications/$$TARGET - icon.files = ../icon.png - icon.path = /opt/mt/applications/$$TARGET - - for(deploymentfolder, DEPLOYMENTFOLDERS) { - item = item$${deploymentfolder} - itemfiles = $${item}.files - $$itemfiles = $$eval($${deploymentfolder}.source) - itempath = $${item}.path - $$itempath = /opt/mt/applications/$$TARGET - export($$itemfiles) - export($$itempath) - INSTALLS += $$item - } - target.path = /opt/mt/applications/$$TARGET - } else { - for(deploymentfolder, DEPLOYMENTFOLDERS) { - item = item$${deploymentfolder} - itemfiles = $${item}.files - $$itemfiles = $$eval($${deploymentfolder}.source) - itempath = $${item}.path - $$itempath = $$[QT_INSTALL_PREFIX]/$$eval($${deploymentfolder}.target) - export($$itemfiles) - export($$itempath) - INSTALLS += $$item - } - target.path = $$[QT_INSTALL_BINS] - } - export(icon.files) - export(icon.path) - export(desktopfile.files) - export(desktopfile.path) - export(target.path) - INSTALLS += desktopfile icon target + copyqmlmeshes.input = QML_MESHES_FILES + copyqmlmeshes.output = $$target_dir/${QMAKE_FILE_IN_BASE}${QMAKE_FILE_EXT} + copyqmlmeshes.commands = $(MKDIR) $$target_dir && $$QMAKE_COPY ${QMAKE_FILE_IN} ${QMAKE_FILE_OUT} + copyqmlmeshes.CONFIG += no_link_no_cle:qan + copyqmlmeshes.variable_out = POST_TARGETDEPS + QMAKE_EXTRA_COMPILERS += copyqmlmeshes } - - export (ICON) - export (INSTALLS) - export (LIBS) - export (QMAKE_EXTRA_TARGETS) } @@ -2,8 +2,6 @@ TEMPLATE = subdirs SUBDIRS += src !gcov: SUBDIRS += util examples demos -include(pkg.pri) - !package: SUBDIRS += tutorials tests.CONFIG = no_default_install @@ -19,40 +17,3 @@ include(doc/doc.pri) contains(QT_CONFIG, opengles1) { error(Qt3D does not support OpenGL ES 1!) } - -include(pkg.pri) - -# Install qt3d.prf into the Qt mkspecs so that "CONFIG += qt3d" -# can be used in applications to build against Qt3D. -package { - distInstalls.files = features/qt3d.prf features/qt3dquick.prf - distInstalls.path = $$QT3D_INSTALL_DATA/mkspecs/features - !qtc_hmtn: INSTALLS += distInstalls -} else { - win32 { - Qt3DFile=$$PWD\\features\\qt3d.prf - Qt3DFile=$$replace(Qt3DFile,/,\\) - featuresDir=$$QT3D_INSTALL_DATA\\mkspecs\\features - featuresDir=$$replace(featuresDir,/,\\) - system(copy "$$Qt3DFile $$featuresDir") - - Qt3DQuickFile=$$PWD\\features\\qt3dquick.prf - Qt3DQuickFile=$$replace(Qt3DQuickFile,/,\\) - system(copy "$$Qt3DQuickFile $$featuresDir") - } else { - Qt3DFile=$$PWD/features/qt3d.prf - featuresDir=$$QT3D_INSTALL_DATA/mkspecs/features - system(cp "$$Qt3DFile $$featuresDir") - - Qt3DQuickFile=$$PWD/features/qt3dquick.prf - system(cp "$$Qt3DQuickFile $$featuresDir") - } -} - -OTHER_FILES += \ - qtc_packaging/debian_harmattan/rules \ - qtc_packaging/debian_harmattan/README \ - qtc_packaging/debian_harmattan/copyright \ - qtc_packaging/debian_harmattan/control \ - qtc_packaging/debian_harmattan/compat \ - qtc_packaging/debian_harmattan/changelog diff --git a/src/imports/shapes/shapes.pro b/src/imports/shapes/shapes.pro index db35548ca..a059bcfda 100644 --- a/src/imports/shapes/shapes.pro +++ b/src/imports/shapes/shapes.pro @@ -51,11 +51,6 @@ package { copyqmlinfra.variable_out = PRE_TARGETDEPS QMAKE_EXTRA_COMPILERS += copyqmlinfra } -else { - copyqmlinfra_install.files = $$QML_INFRA_FILES - copyqmlinfra_install.path = $$[QT_INSTALL_IMPORTS]/Qt3D/Shapes - INSTALLS += copyqmlinfra_install -} OTHER_FILES += \ README.plugins_types \ diff --git a/src/imports/threed/shaderprogram.cpp b/src/imports/threed/shaderprogram.cpp index 32b0a46dd..f8d6f6766 100644 --- a/src/imports/threed/shaderprogram.cpp +++ b/src/imports/threed/shaderprogram.cpp @@ -42,12 +42,13 @@ #include "shaderprogram.h" #include "shaderprogram_p.h" #include "qglabstracteffect.h" -#include <QtOpenGL/qglshaderprogram.h> -#include <QWeakPointer> +#include <QOpenGLShaderProgram> +#include "qglscenenode.h" +#include <QWeakPointer> #include <QDeclarativeEngine> #include <QDeclarativeContext> -#include "qglscenenode.h" + /*! \qmlclass ShaderProgram ShaderProgram \brief The ShaderProgram item is derivative class of the more general Effect class in QML/3d. @@ -258,7 +259,7 @@ ShaderProgramEffect::~ShaderProgramEffect() bool ShaderProgramEffect::create (const QString& vertexShader, const QString& fragmentShader) { - if (!QGLShaderProgram::hasOpenGLShaderPrograms()) + if (!QOpenGLShaderProgram::hasOpenGLShaderPrograms()) return false; setVertexShader(vertexShader.toLatin1()); @@ -330,7 +331,7 @@ void ShaderProgramEffect::afterLink() \internal Precondition: list is a list of floats */ -static inline void setUniformFromFloatList(QGLShaderProgram *program, int uniformLocation, QList<QVariant> list) +static inline void setUniformFromFloatList(QOpenGLShaderProgram *program, int uniformLocation, QList<QVariant> list) { switch(list.length()) { @@ -450,7 +451,7 @@ inline QGLTexture2D* ShaderProgramEffect::textureForUniformValue(int uniformLoca inline bool ShaderProgramEffect::setUniformForPropertyIndex(int propertyIndex, QGLPainter *painter) { - QGLShaderProgram *program = this->program(); + QOpenGLShaderProgram *program = this->program(); int uniformLocation = propertyIdsToUniformLocations[propertyIndex]; QVariant value = diff --git a/src/imports/threed/shaderprogram_p.h b/src/imports/threed/shaderprogram_p.h index 1946be38d..9646f96c2 100644 --- a/src/imports/threed/shaderprogram_p.h +++ b/src/imports/threed/shaderprogram_p.h @@ -43,7 +43,7 @@ #define SHADERPROGRAM_P_H #include <QtCore/qsharedpointer.h> -#include <QtOpenGL/qglshaderprogram.h> +#include <QOpenGLShaderProgram> #include "qdeclarativeeffect.h" #include "qglshaderprogrameffect.h" diff --git a/src/imports/threed/threed.pro b/src/imports/threed/threed.pro index d444ec1d6..ca766683d 100644 --- a/src/imports/threed/threed.pro +++ b/src/imports/threed/threed.pro @@ -2,7 +2,7 @@ TEMPLATE = lib TARGET = qthreedqmlplugin CONFIG += qt plugin -QT += widgets opengl declarative quick qt3d qt3dquick +QT += quick declarative qt3d qt3dquick DESTDIR = $$QT.qt3dquick.imports/Qt3D target.path = $$[QT_INSTALL_IMPORTS]/Qt3D @@ -28,12 +28,16 @@ HEADERS += \ skybox.h \ billboarditem3d.h - QML_INFRA_FILES = \ - qmldir \ - library.xml \ - plugins.qmltypes +QML_INFRA_FILES = \ + qmldir \ + library.xml \ + plugins.qmltypes -!package { +package { + copyqmlinfra_install.files = $$QML_INFRA_FILES + copyqmlinfra_install.path = $$[QT_INSTALL_IMPORTS]/Qt3D + INSTALLS += copyqmlinfra_install +} else { copyqmlinfra.input = QML_INFRA_FILES copyqmlinfra.output = $$[QT_INSTALL_IMPORTS]/Qt3D/${QMAKE_FILE_IN_BASE}${QMAKE_FILE_EXT} copyqmlinfra.commands = $$QMAKE_COPY ${QMAKE_FILE_IN} ${QMAKE_FILE_OUT} @@ -41,11 +45,6 @@ HEADERS += \ copyqmlinfra.variable_out = PRE_TARGETDEPS QMAKE_EXTRA_COMPILERS += copyqmlinfra } -else { - copyqmlinfra_install.files = $$QML_INFRA_FILES - copyqmlinfra_install.path = $$[QT_INSTALL_IMPORTS]/Qt3D - INSTALLS += copyqmlinfra_install -} OTHER_FILES += \ README.plugins_types \ diff --git a/src/imports/threed/viewport.cpp b/src/imports/threed/viewport.cpp index fe2ee9146..e59830283 100644 --- a/src/imports/threed/viewport.cpp +++ b/src/imports/threed/viewport.cpp @@ -51,20 +51,17 @@ #include "qglframebufferobjectsurface.h" #include "skybox.h" -#include <QtGui/QOpenGLContext> -#include <QtGui/QOpenGLFramebufferObject> - -#include <QtGui/qpainter.h> -#include <QtWidgets/qgraphicsview.h> -#include <QtWidgets/qgraphicsscene.h> -#include <QtWidgets/qgraphicssceneevent.h> -#include <QtGui/qevent.h> -#include <QtCore/qtimer.h> -#include <QtCore/qcoreapplication.h> -#include <QtDeclarative/qdeclarativeinfo.h> -#include <QtQuick/QQuickCanvas> -#include <QtQuick/QSGEngine> -#include <QtOpenGL/qglbuffer.h> +#include <QOpenGLContext> +#include <QOpenGLFramebufferObject> + +#include <QPainter> +#include <QEvent> +#include <QTimer> +#include <QCoreApplication> +#include <QDeclarativeInfo> +#include <QQuickCanvas> +#include <QSGEngine> +#include <QOpenGLBuffer> #include <QtCore/qthread.h> #include <QtCore/qmutex.h> #include <QtCore/qmath.h> diff --git a/src/plugins/sceneformats/3ds/qgl3dsmesh.cpp b/src/plugins/sceneformats/3ds/qgl3dsmesh.cpp index a09361242..9913b4d28 100644 --- a/src/plugins/sceneformats/3ds/qgl3dsmesh.cpp +++ b/src/plugins/sceneformats/3ds/qgl3dsmesh.cpp @@ -656,7 +656,7 @@ void QGL3dsMesh::checkTextures(int material) // all texture coordinates from 3ds have to be flipped because // 3ds uses the correct coordinate system, whilst qt uses // upside-down coordinates - m_texFlip = (tex->bindOptions() & QGLContext::InvertedYBindOption) == 0; + m_texFlip = (tex->bindOptions() & QGLTexture2D::InvertedYBindOption) == 0; } } diff --git a/src/private/qglextensions_p.h b/src/private/qglextensions_p.h index c2dbcd950..fe00f0799 100644 --- a/src/private/qglextensions_p.h +++ b/src/private/qglextensions_p.h @@ -732,151 +732,151 @@ struct QGLExtensionFuncs #endif #if !defined(QT_OPENGL_ES_2) -#define glProgramStringARB QGLContextPrivate::extensionFuncs(ctx).qt_glProgramStringARB -#define glBindProgramARB QGLContextPrivate::extensionFuncs(ctx).qt_glBindProgramARB -#define glDeleteProgramsARB QGLContextPrivate::extensionFuncs(ctx).qt_glDeleteProgramsARB -#define glGenProgramsARB QGLContextPrivate::extensionFuncs(ctx).qt_glGenProgramsARB -#define glProgramLocalParameter4fvARB QGLContextPrivate::extensionFuncs(ctx).qt_glProgramLocalParameter4fvARB +#define glProgramStringARB QOpenGLContextPrivate::extensionFuncs(ctx).qt_glProgramStringARB +#define glBindProgramARB QOpenGLContextPrivate::extensionFuncs(ctx).qt_glBindProgramARB +#define glDeleteProgramsARB QOpenGLContextPrivate::extensionFuncs(ctx).qt_glDeleteProgramsARB +#define glGenProgramsARB QOpenGLContextPrivate::extensionFuncs(ctx).qt_glGenProgramsARB +#define glProgramLocalParameter4fvARB QOpenGLContextPrivate::extensionFuncs(ctx).qt_glProgramLocalParameter4fvARB -#define glActiveStencilFaceEXT QGLContextPrivate::extensionFuncs(ctx).qt_glActiveStencilFaceEXT +#define glActiveStencilFaceEXT QOpenGLContextPrivate::extensionFuncs(ctx).qt_glActiveStencilFaceEXT -#define glMultiTexCoord4f QGLContextPrivate::extensionFuncs(ctx).qt_glMultiTexCoord4f +#define glMultiTexCoord4f QOpenGLContextPrivate::extensionFuncs(ctx).qt_glMultiTexCoord4f -#define glActiveTexture QGLContextPrivate::extensionFuncs(ctx).qt_glActiveTexture +#define glActiveTexture QOpenGLContextPrivate::extensionFuncs(ctx).qt_glActiveTexture #endif // !defined(QT_OPENGL_ES_2) // FBOs #if !defined(QT_OPENGL_ES_2) -#define glIsRenderbuffer QGLContextPrivate::extensionFuncs(ctx).qt_glIsRenderbuffer -#define glBindRenderbuffer QGLContextPrivate::extensionFuncs(ctx).qt_glBindRenderbuffer -#define glDeleteRenderbuffers QGLContextPrivate::extensionFuncs(ctx).qt_glDeleteRenderbuffers -#define glGenRenderbuffers QGLContextPrivate::extensionFuncs(ctx).qt_glGenRenderbuffers -#define glRenderbufferStorage QGLContextPrivate::extensionFuncs(ctx).qt_glRenderbufferStorage -#define glGetRenderbufferParameteriv QGLContextPrivate::extensionFuncs(ctx).qt_glGetRenderbufferParameteriv -#define glIsFramebuffer QGLContextPrivate::extensionFuncs(ctx).qt_glIsFramebuffer -#define glBindFramebuffer QGLContextPrivate::extensionFuncs(ctx).qt_glBindFramebuffer -#define glDeleteFramebuffers QGLContextPrivate::extensionFuncs(ctx).qt_glDeleteFramebuffers -#define glGenFramebuffers QGLContextPrivate::extensionFuncs(ctx).qt_glGenFramebuffers -#define glCheckFramebufferStatus QGLContextPrivate::extensionFuncs(ctx).qt_glCheckFramebufferStatus -#define glFramebufferTexture2D QGLContextPrivate::extensionFuncs(ctx).qt_glFramebufferTexture2D -#define glFramebufferRenderbuffer QGLContextPrivate::extensionFuncs(ctx).qt_glFramebufferRenderbuffer -#define glGetFramebufferAttachmentParameteriv QGLContextPrivate::extensionFuncs(ctx).qt_glGetFramebufferAttachmentParameteriv -#define glGenerateMipmap QGLContextPrivate::extensionFuncs(ctx).qt_glGenerateMipmap +#define glIsRenderbuffer QOpenGLContextPrivate::extensionFuncs(ctx).qt_glIsRenderbuffer +#define glBindRenderbuffer QOpenGLContextPrivate::extensionFuncs(ctx).qt_glBindRenderbuffer +#define glDeleteRenderbuffers QOpenGLContextPrivate::extensionFuncs(ctx).qt_glDeleteRenderbuffers +#define glGenRenderbuffers QOpenGLContextPrivate::extensionFuncs(ctx).qt_glGenRenderbuffers +#define glRenderbufferStorage QOpenGLContextPrivate::extensionFuncs(ctx).qt_glRenderbufferStorage +#define glGetRenderbufferParameteriv QOpenGLContextPrivate::extensionFuncs(ctx).qt_glGetRenderbufferParameteriv +#define glIsFramebuffer QOpenGLContextPrivate::extensionFuncs(ctx).qt_glIsFramebuffer +#define glBindFramebuffer QOpenGLContextPrivate::extensionFuncs(ctx).qt_glBindFramebuffer +#define glDeleteFramebuffers QOpenGLContextPrivate::extensionFuncs(ctx).qt_glDeleteFramebuffers +#define glGenFramebuffers QOpenGLContextPrivate::extensionFuncs(ctx).qt_glGenFramebuffers +#define glCheckFramebufferStatus QOpenGLContextPrivate::extensionFuncs(ctx).qt_glCheckFramebufferStatus +#define glFramebufferTexture2D QOpenGLContextPrivate::extensionFuncs(ctx).qt_glFramebufferTexture2D +#define glFramebufferRenderbuffer QOpenGLContextPrivate::extensionFuncs(ctx).qt_glFramebufferRenderbuffer +#define glGetFramebufferAttachmentParameteriv QOpenGLContextPrivate::extensionFuncs(ctx).qt_glGetFramebufferAttachmentParameteriv +#define glGenerateMipmap QOpenGLContextPrivate::extensionFuncs(ctx).qt_glGenerateMipmap #endif // QT_OPENGL_ES_2 -#define glBlitFramebufferEXT QGLContextPrivate::extensionFuncs(ctx).qt_glBlitFramebufferEXT -#define glRenderbufferStorageMultisampleEXT QGLContextPrivate::extensionFuncs(ctx).qt_glRenderbufferStorageMultisampleEXT +#define glBlitFramebufferEXT QOpenGLContextPrivate::extensionFuncs(ctx).qt_glBlitFramebufferEXT +#define glRenderbufferStorageMultisampleEXT QOpenGLContextPrivate::extensionFuncs(ctx).qt_glRenderbufferStorageMultisampleEXT // Buffer objects #if defined(QGL_RESOLVE_BUFFER_FUNCS) -#define glBindBuffer QGLContextPrivate::extensionFuncs(ctx).qt_glBindBuffer -#define glDeleteBuffers QGLContextPrivate::extensionFuncs(ctx).qt_glDeleteBuffers -#define glGenBuffers QGLContextPrivate::extensionFuncs(ctx).qt_glGenBuffers -#define glBufferData QGLContextPrivate::extensionFuncs(ctx).qt_glBufferData -#define glBufferSubData QGLContextPrivate::extensionFuncs(ctx).qt_glBufferSubData -#define glGetBufferSubData QGLContextPrivate::extensionFuncs(ctx).qt_glGetBufferSubData -#define glGetBufferParameteriv QGLContextPrivate::extensionFuncs(ctx).qt_glGetBufferParameteriv +#define glBindBuffer QOpenGLContextPrivate::extensionFuncs(ctx).qt_glBindBuffer +#define glDeleteBuffers QOpenGLContextPrivate::extensionFuncs(ctx).qt_glDeleteBuffers +#define glGenBuffers QOpenGLContextPrivate::extensionFuncs(ctx).qt_glGenBuffers +#define glBufferData QOpenGLContextPrivate::extensionFuncs(ctx).qt_glBufferData +#define glBufferSubData QOpenGLContextPrivate::extensionFuncs(ctx).qt_glBufferSubData +#define glGetBufferSubData QOpenGLContextPrivate::extensionFuncs(ctx).qt_glGetBufferSubData +#define glGetBufferParameteriv QOpenGLContextPrivate::extensionFuncs(ctx).qt_glGetBufferParameteriv #endif -#define glMapBufferARB QGLContextPrivate::extensionFuncs(ctx).qt_glMapBufferARB -#define glUnmapBufferARB QGLContextPrivate::extensionFuncs(ctx).qt_glUnmapBufferARB +#define glMapBufferARB QOpenGLContextPrivate::extensionFuncs(ctx).qt_glMapBufferARB +#define glUnmapBufferARB QOpenGLContextPrivate::extensionFuncs(ctx).qt_glUnmapBufferARB // GLSL #if !defined(QT_OPENGL_ES_2) -#define glCreateShader QGLContextPrivate::extensionFuncs(ctx).qt_glCreateShader -#define glShaderSource QGLContextPrivate::extensionFuncs(ctx).qt_glShaderSource -#define glShaderBinary QGLContextPrivate::extensionFuncs(ctx).qt_glShaderBinary -#define glCompileShader QGLContextPrivate::extensionFuncs(ctx).qt_glCompileShader -#define glDeleteShader QGLContextPrivate::extensionFuncs(ctx).qt_glDeleteShader -#define glIsShader QGLContextPrivate::extensionFuncs(ctx).qt_glIsShader - -#define glCreateProgram QGLContextPrivate::extensionFuncs(ctx).qt_glCreateProgram -#define glAttachShader QGLContextPrivate::extensionFuncs(ctx).qt_glAttachShader -#define glDetachShader QGLContextPrivate::extensionFuncs(ctx).qt_glDetachShader -#define glLinkProgram QGLContextPrivate::extensionFuncs(ctx).qt_glLinkProgram -#define glUseProgram QGLContextPrivate::extensionFuncs(ctx).qt_glUseProgram -#define glDeleteProgram QGLContextPrivate::extensionFuncs(ctx).qt_glDeleteProgram -#define glIsProgram QGLContextPrivate::extensionFuncs(ctx).qt_glIsProgram - -#define glGetShaderInfoLog QGLContextPrivate::extensionFuncs(ctx).qt_glGetShaderInfoLog -#define glGetShaderiv QGLContextPrivate::extensionFuncs(ctx).qt_glGetShaderiv -#define glGetShaderSource QGLContextPrivate::extensionFuncs(ctx).qt_glGetShaderSource -#define glGetProgramiv QGLContextPrivate::extensionFuncs(ctx).qt_glGetProgramiv -#define glGetProgramInfoLog QGLContextPrivate::extensionFuncs(ctx).qt_glGetProgramInfoLog - -#define glGetUniformLocation QGLContextPrivate::extensionFuncs(ctx).qt_glGetUniformLocation -#define glUniform4fv QGLContextPrivate::extensionFuncs(ctx).qt_glUniform4fv -#define glUniform3fv QGLContextPrivate::extensionFuncs(ctx).qt_glUniform3fv -#define glUniform2fv QGLContextPrivate::extensionFuncs(ctx).qt_glUniform2fv -#define glUniform1fv QGLContextPrivate::extensionFuncs(ctx).qt_glUniform1fv -#define glUniform1i QGLContextPrivate::extensionFuncs(ctx).qt_glUniform1i -#define glUniform1iv QGLContextPrivate::extensionFuncs(ctx).qt_glUniform1iv -#define glUniformMatrix2fv QGLContextPrivate::extensionFuncs(ctx).qt_glUniformMatrix2fv -#define glUniformMatrix3fv QGLContextPrivate::extensionFuncs(ctx).qt_glUniformMatrix3fv -#define glUniformMatrix4fv QGLContextPrivate::extensionFuncs(ctx).qt_glUniformMatrix4fv -#define glUniformMatrix2x3fv QGLContextPrivate::extensionFuncs(ctx).qt_glUniformMatrix2x3fv -#define glUniformMatrix2x4fv QGLContextPrivate::extensionFuncs(ctx).qt_glUniformMatrix2x4fv -#define glUniformMatrix3x2fv QGLContextPrivate::extensionFuncs(ctx).qt_glUniformMatrix3x2fv -#define glUniformMatrix3x4fv QGLContextPrivate::extensionFuncs(ctx).qt_glUniformMatrix3x4fv -#define glUniformMatrix4x2fv QGLContextPrivate::extensionFuncs(ctx).qt_glUniformMatrix4x2fv -#define glUniformMatrix4x3fv QGLContextPrivate::extensionFuncs(ctx).qt_glUniformMatrix4x3fv - -#define glBindAttribLocation QGLContextPrivate::extensionFuncs(ctx).qt_glBindAttribLocation -#define glGetAttribLocation QGLContextPrivate::extensionFuncs(ctx).qt_glGetAttribLocation -#define glVertexAttrib1fv QGLContextPrivate::extensionFuncs(ctx).qt_glVertexAttrib1fv -#define glVertexAttrib2fv QGLContextPrivate::extensionFuncs(ctx).qt_glVertexAttrib2fv -#define glVertexAttrib3fv QGLContextPrivate::extensionFuncs(ctx).qt_glVertexAttrib3fv -#define glVertexAttrib4fv QGLContextPrivate::extensionFuncs(ctx).qt_glVertexAttrib4fv -#define glVertexAttribPointer QGLContextPrivate::extensionFuncs(ctx).qt_glVertexAttribPointer -#define glDisableVertexAttribArray QGLContextPrivate::extensionFuncs(ctx).qt_glDisableVertexAttribArray -#define glEnableVertexAttribArray QGLContextPrivate::extensionFuncs(ctx).qt_glEnableVertexAttribArray +#define glCreateShader QOpenGLContextPrivate::extensionFuncs(ctx).qt_glCreateShader +#define glShaderSource QOpenGLContextPrivate::extensionFuncs(ctx).qt_glShaderSource +#define glShaderBinary QOpenGLContextPrivate::extensionFuncs(ctx).qt_glShaderBinary +#define glCompileShader QOpenGLContextPrivate::extensionFuncs(ctx).qt_glCompileShader +#define glDeleteShader QOpenGLContextPrivate::extensionFuncs(ctx).qt_glDeleteShader +#define glIsShader QOpenGLContextPrivate::extensionFuncs(ctx).qt_glIsShader + +#define glCreateProgram QOpenGLContextPrivate::extensionFuncs(ctx).qt_glCreateProgram +#define glAttachShader QOpenGLContextPrivate::extensionFuncs(ctx).qt_glAttachShader +#define glDetachShader QOpenGLContextPrivate::extensionFuncs(ctx).qt_glDetachShader +#define glLinkProgram QOpenGLContextPrivate::extensionFuncs(ctx).qt_glLinkProgram +#define glUseProgram QOpenGLContextPrivate::extensionFuncs(ctx).qt_glUseProgram +#define glDeleteProgram QOpenGLContextPrivate::extensionFuncs(ctx).qt_glDeleteProgram +#define glIsProgram QOpenGLContextPrivate::extensionFuncs(ctx).qt_glIsProgram + +#define glGetShaderInfoLog QOpenGLContextPrivate::extensionFuncs(ctx).qt_glGetShaderInfoLog +#define glGetShaderiv QOpenGLContextPrivate::extensionFuncs(ctx).qt_glGetShaderiv +#define glGetShaderSource QOpenGLContextPrivate::extensionFuncs(ctx).qt_glGetShaderSource +#define glGetProgramiv QOpenGLContextPrivate::extensionFuncs(ctx).qt_glGetProgramiv +#define glGetProgramInfoLog QOpenGLContextPrivate::extensionFuncs(ctx).qt_glGetProgramInfoLog + +#define glGetUniformLocation QOpenGLContextPrivate::extensionFuncs(ctx).qt_glGetUniformLocation +#define glUniform4fv QOpenGLContextPrivate::extensionFuncs(ctx).qt_glUniform4fv +#define glUniform3fv QOpenGLContextPrivate::extensionFuncs(ctx).qt_glUniform3fv +#define glUniform2fv QOpenGLContextPrivate::extensionFuncs(ctx).qt_glUniform2fv +#define glUniform1fv QOpenGLContextPrivate::extensionFuncs(ctx).qt_glUniform1fv +#define glUniform1i QOpenGLContextPrivate::extensionFuncs(ctx).qt_glUniform1i +#define glUniform1iv QOpenGLContextPrivate::extensionFuncs(ctx).qt_glUniform1iv +#define glUniformMatrix2fv QOpenGLContextPrivate::extensionFuncs(ctx).qt_glUniformMatrix2fv +#define glUniformMatrix3fv QOpenGLContextPrivate::extensionFuncs(ctx).qt_glUniformMatrix3fv +#define glUniformMatrix4fv QOpenGLContextPrivate::extensionFuncs(ctx).qt_glUniformMatrix4fv +#define glUniformMatrix2x3fv QOpenGLContextPrivate::extensionFuncs(ctx).qt_glUniformMatrix2x3fv +#define glUniformMatrix2x4fv QOpenGLContextPrivate::extensionFuncs(ctx).qt_glUniformMatrix2x4fv +#define glUniformMatrix3x2fv QOpenGLContextPrivate::extensionFuncs(ctx).qt_glUniformMatrix3x2fv +#define glUniformMatrix3x4fv QOpenGLContextPrivate::extensionFuncs(ctx).qt_glUniformMatrix3x4fv +#define glUniformMatrix4x2fv QOpenGLContextPrivate::extensionFuncs(ctx).qt_glUniformMatrix4x2fv +#define glUniformMatrix4x3fv QOpenGLContextPrivate::extensionFuncs(ctx).qt_glUniformMatrix4x3fv + +#define glBindAttribLocation QOpenGLContextPrivate::extensionFuncs(ctx).qt_glBindAttribLocation +#define glGetAttribLocation QOpenGLContextPrivate::extensionFuncs(ctx).qt_glGetAttribLocation +#define glVertexAttrib1fv QOpenGLContextPrivate::extensionFuncs(ctx).qt_glVertexAttrib1fv +#define glVertexAttrib2fv QOpenGLContextPrivate::extensionFuncs(ctx).qt_glVertexAttrib2fv +#define glVertexAttrib3fv QOpenGLContextPrivate::extensionFuncs(ctx).qt_glVertexAttrib3fv +#define glVertexAttrib4fv QOpenGLContextPrivate::extensionFuncs(ctx).qt_glVertexAttrib4fv +#define glVertexAttribPointer QOpenGLContextPrivate::extensionFuncs(ctx).qt_glVertexAttribPointer +#define glDisableVertexAttribArray QOpenGLContextPrivate::extensionFuncs(ctx).qt_glDisableVertexAttribArray +#define glEnableVertexAttribArray QOpenGLContextPrivate::extensionFuncs(ctx).qt_glEnableVertexAttribArray #else // QT_OPENGL_ES_2 -#define glGetProgramBinaryOES QGLContextPrivate::extensionFuncs(ctx).qt_glGetProgramBinaryOES -#define glProgramBinaryOES QGLContextPrivate::extensionFuncs(ctx).qt_glProgramBinaryOES +#define glGetProgramBinaryOES QOpenGLContextPrivate::extensionFuncs(ctx).qt_glGetProgramBinaryOES +#define glProgramBinaryOES QOpenGLContextPrivate::extensionFuncs(ctx).qt_glProgramBinaryOES #endif // QT_OPENGL_ES_2 #if !defined(QT_OPENGL_ES_2) -#define glStencilOpSeparate QGLContextPrivate::extensionFuncs(ctx).qt_glStencilOpSeparate -#define glBlendColor QGLContextPrivate::extensionFuncs(ctx).qt_glBlendColor +#define glStencilOpSeparate QOpenGLContextPrivate::extensionFuncs(ctx).qt_glStencilOpSeparate +#define glBlendColor QOpenGLContextPrivate::extensionFuncs(ctx).qt_glBlendColor #endif #if defined(QT_OPENGL_ES_2) #define glClearDepth glClearDepthf #endif -#define glProgramParameteriEXT QGLContextPrivate::extensionFuncs(ctx).qt_glProgramParameteriEXT -#define glFramebufferTextureEXT QGLContextPrivate::extensionFuncs(ctx).qt_glFramebufferTextureEXT -#define glFramebufferTextureLayerEXT QGLContextPrivate::extensionFuncs(ctx).qt_glFramebufferTextureLayerEXT -#define glFramebufferTextureFaceEXT QGLContextPrivate::extensionFuncs(ctx).qt_glFramebufferTextureFaceEXT +#define glProgramParameteriEXT QOpenGLContextPrivate::extensionFuncs(ctx).qt_glProgramParameteriEXT +#define glFramebufferTextureEXT QOpenGLContextPrivate::extensionFuncs(ctx).qt_glFramebufferTextureEXT +#define glFramebufferTextureLayerEXT QOpenGLContextPrivate::extensionFuncs(ctx).qt_glFramebufferTextureLayerEXT +#define glFramebufferTextureFaceEXT QOpenGLContextPrivate::extensionFuncs(ctx).qt_glFramebufferTextureFaceEXT #if !defined(QT_OPENGL_ES) -#define glCompressedTexImage2D QGLContextPrivate::extensionFuncs(ctx).qt_glCompressedTexImage2DARB +#define glCompressedTexImage2D QOpenGLContextPrivate::extensionFuncs(ctx).qt_glCompressedTexImage2DARB #endif #ifndef QT_NO_EGL // OES_EGL_image -#define glEGLImageTargetTexture2DOES QGLContextPrivate::extensionFuncs(ctx).qt_glEGLImageTargetTexture2DOES -#define glEGLImageTargetRenderbufferStorageOES QGLContextPrivate::extensionFuncs(ctx).qt_glEGLImageTargetRenderbufferStorageOES +#define glEGLImageTargetTexture2DOES QOpenGLContextPrivate::extensionFuncs(ctx).qt_glEGLImageTargetTexture2DOES +#define glEGLImageTargetRenderbufferStorageOES QOpenGLContextPrivate::extensionFuncs(ctx).qt_glEGLImageTargetRenderbufferStorageOES #endif -extern bool qt_resolve_framebufferobject_extensions(QGLContext *ctx); -bool qt_resolve_buffer_extensions(QGLContext *ctx); +extern bool qt_resolve_framebufferobject_extensions(QOpenGLContext *ctx); +bool qt_resolve_buffer_extensions(QOpenGLContext *ctx); -bool qt_resolve_version_1_3_functions(QGLContext *ctx); -bool qt_resolve_version_2_0_functions(QGLContext *ctx); -bool qt_resolve_stencil_face_extension(QGLContext *ctx); -bool qt_resolve_frag_program_extensions(QGLContext *ctx); +bool qt_resolve_version_1_3_functions(QOpenGLContext *ctx); +bool qt_resolve_version_2_0_functions(QOpenGLContext *ctx); +bool qt_resolve_stencil_face_extension(QOpenGLContext *ctx); +bool qt_resolve_frag_program_extensions(QOpenGLContext *ctx); -bool qt_resolve_glsl_extensions(QGLContext *ctx); +bool qt_resolve_glsl_extensions(QOpenGLContext *ctx); #ifndef QT_NO_EGL -Q_OPENGL_EXPORT bool qt_resolve_eglimage_gl_extensions(QGLContext *ctx); +Q_OPENGL_EXPORT bool qt_resolve_eglimage_gl_extensions(QOpenGLContext *ctx); #endif QT_END_NAMESPACE diff --git a/src/quick3d/qdeclarativeeffect.cpp b/src/quick3d/qdeclarativeeffect.cpp index cfe54cd78..a4216a04e 100644 --- a/src/quick3d/qdeclarativeeffect.cpp +++ b/src/quick3d/qdeclarativeeffect.cpp @@ -315,8 +315,8 @@ void QDeclarativeEffect::setTextureImage(const QImage& value) tex->setImage(value); // prevents artifacts due to texture smoothing wrapping around edges of texture - tex->setHorizontalWrap(QGL::Clamp); - tex->setVerticalWrap(QGL::Clamp); + tex->setHorizontalWrap(QGL::ClampToEdge); + tex->setVerticalWrap(QGL::ClampToEdge); emit effectChanged(); } diff --git a/src/threed/arrays/qglattributedescription.h b/src/threed/arrays/qglattributedescription.h index 1ecd8399f..091b5a936 100644 --- a/src/threed/arrays/qglattributedescription.h +++ b/src/threed/arrays/qglattributedescription.h @@ -42,10 +42,11 @@ #ifndef QGLATTRIBUTEDESCRIPTION_H #define QGLATTRIBUTEDESCRIPTION_H -#include <QtOpenGL/qgl.h> #include "qt3dglobal.h" #include "qglnamespace.h" +#include <QOpenGLBuffer> + QT_BEGIN_HEADER QT_BEGIN_NAMESPACE diff --git a/src/threed/arrays/qglindexbuffer.cpp b/src/threed/arrays/qglindexbuffer.cpp index db00f9f9d..c3a4bfb4f 100644 --- a/src/threed/arrays/qglindexbuffer.cpp +++ b/src/threed/arrays/qglindexbuffer.cpp @@ -43,8 +43,8 @@ #include "qglpainter.h" #include "qglpainter_p.h" #include "qglext_p.h" -#include <QtOpenGL/qgl.h> -#include <QtCore/qatomic.h> + +#include <QAtomicInt> QT_BEGIN_NAMESPACE @@ -79,7 +79,7 @@ public: : ref(1) , indexCount(0) , elementType(GL_UNSIGNED_SHORT) - , buffer(QGLBuffer::IndexBuffer) + , buffer(QOpenGLBuffer::IndexBuffer) #ifdef QT_OPENGL_ES , hasIntBuffers(qt_has_uint_buffers()) #else @@ -92,7 +92,7 @@ public: QArray<ushort> indexesShort; QArray<uint> indexesInt; GLenum elementType; - QGLBuffer buffer; + QOpenGLBuffer buffer; bool hasIntBuffers; void append(const QGLIndexBufferPrivate *other, uint offset, int start); @@ -170,11 +170,11 @@ QArray<uint> QGLIndexBuffer::indexesUInt() const /*! Returns the usage pattern for this index buffer. - The default value is QGLBuffer::StaticDraw. + The default value is QOpenGLBuffer::StaticDraw. \sa setUsagePattern() */ -QGLBuffer::UsagePattern QGLIndexBuffer::usagePattern() const +QOpenGLBuffer::UsagePattern QGLIndexBuffer::usagePattern() const { Q_D(const QGLIndexBuffer); return d->buffer.usagePattern(); @@ -187,7 +187,7 @@ QGLBuffer::UsagePattern QGLIndexBuffer::usagePattern() const \sa usagePattern(), upload() */ -void QGLIndexBuffer::setUsagePattern(QGLBuffer::UsagePattern value) +void QGLIndexBuffer::setUsagePattern(QOpenGLBuffer::UsagePattern value) { Q_D(QGLIndexBuffer); d->buffer.setUsagePattern(value); @@ -440,12 +440,12 @@ bool QGLIndexBuffer::isUploaded() const } /*! - Returns the QGLBuffer in use by this index buffer object, + Returns the QOpenGLBuffer in use by this index buffer object, so that its properties or contents can be modified directly. \sa isUploaded() */ -QGLBuffer QGLIndexBuffer::buffer() const +QOpenGLBuffer QGLIndexBuffer::buffer() const { Q_D(const QGLIndexBuffer); return d->buffer; @@ -455,8 +455,8 @@ QGLBuffer QGLIndexBuffer::buffer() const Binds this index buffer to the current GL context. Returns false if binding was not possible, usually because upload() has not been called. - The buffer must be bound to the same QGLContext current when upload() - was called, or to another QGLContext that is sharing with it. + The buffer must be bound to the same QOpenGLContext current when upload() + was called, or to another QOpenGLContext that is sharing with it. Otherwise, false will be returned from this function. \sa release(), upload() @@ -470,7 +470,7 @@ bool QGLIndexBuffer::bind() /*! Releases this index buffer from the current GL context. - This function must be called with the same QGLContext current + This function must be called with the same QOpenGLContext current as when bind() was called on the index buffer. \sa bind() @@ -715,7 +715,7 @@ void QGLPainter::draw(QGL::DrawingMode mode, const QGLIndexBuffer& indexes) if (id) d->buffer.bind(); else - QGLBuffer::release(QGLBuffer::IndexBuffer); + QOpenGLBuffer::release(QOpenGLBuffer::IndexBuffer); d_ptr->boundIndexBuffer = id; } if (id) { @@ -753,7 +753,7 @@ void QGLPainter::draw(QGL::DrawingMode mode, const QGLIndexBuffer& indexes, int if (id) d->buffer.bind(); else - QGLBuffer::release(QGLBuffer::IndexBuffer); + QOpenGLBuffer::release(QOpenGLBuffer::IndexBuffer); d_ptr->boundIndexBuffer = id; } if (id) { diff --git a/src/threed/arrays/qglindexbuffer.h b/src/threed/arrays/qglindexbuffer.h index 68a1d3cd2..bf25979c0 100644 --- a/src/threed/arrays/qglindexbuffer.h +++ b/src/threed/arrays/qglindexbuffer.h @@ -42,8 +42,8 @@ #ifndef QGLINDEXBUFFER_H #define QGLINDEXBUFFER_H -#include <QtOpenGL/qgl.h> -#include <QtOpenGL/qglbuffer.h> +#include <QOpenGLBuffer> + #include "qglnamespace.h" #include "qarray.h" @@ -65,8 +65,8 @@ public: QGLIndexBuffer& operator=(const QGLIndexBuffer& other); - QGLBuffer::UsagePattern usagePattern() const; - void setUsagePattern(QGLBuffer::UsagePattern value); + QOpenGLBuffer::UsagePattern usagePattern() const; + void setUsagePattern(QOpenGLBuffer::UsagePattern value); QArray<ushort> indexesUShort() const; QArray<uint> indexesUInt() const; @@ -85,7 +85,7 @@ public: bool upload(); bool isUploaded() const; - QGLBuffer buffer() const; + QOpenGLBuffer buffer() const; bool bind(); void release(); diff --git a/src/threed/arrays/qglvertexbundle.cpp b/src/threed/arrays/qglvertexbundle.cpp index 3515f36e6..b63de6fb4 100644 --- a/src/threed/arrays/qglvertexbundle.cpp +++ b/src/threed/arrays/qglvertexbundle.cpp @@ -44,7 +44,7 @@ #include "qglabstracteffect.h" #include <QtCore/qlist.h> #include <QtCore/qatomic.h> -#include <QtOpenGL/qglshaderprogram.h> +#include <QOpenGLShaderProgram> QT_BEGIN_NAMESPACE @@ -62,7 +62,7 @@ QT_BEGIN_NAMESPACE they may be repacked for greater drawing efficiency. For general-purpose vertex buffers that can be allocated and modified - in-place, use QGLBuffer instead. + in-place, use QOpenGLBuffer instead. */ /*! @@ -384,7 +384,7 @@ bool QGLVertexBundle::upload() // Determine how to upload the data, using a map if possible. // Interleave the data into the final buffer. We do it in // sections so as to keep locality problems to a minimum. - void *mapped = d->buffer.map(QGLBuffer::WriteOnly); + void *mapped = d->buffer.map(QOpenGLBuffer::WriteOnly); int offset = 0; QArray<float> temp; float *dst; @@ -449,12 +449,12 @@ bool QGLVertexBundle::isUploaded() const } /*! - Returns the QGLBuffer in use by this vertex bundle object, + Returns the QOpenGLBuffer in use by this vertex bundle object, so that its properties or contents can be modified directly. \sa isUploaded() */ -QGLBuffer QGLVertexBundle::buffer() const +QOpenGLBuffer QGLVertexBundle::buffer() const { Q_D(const QGLVertexBundle); return d->buffer; @@ -465,8 +465,8 @@ QGLBuffer QGLVertexBundle::buffer() const context. Returns false if binding was not possible, usually because upload() has not been called. - The buffer must be bound to the same QGLContext current when upload() - was called, or to another QGLContext that is sharing with it. + The buffer must be bound to the same QOpenGLContext current when upload() + was called, or to another QOpenGLContext that is sharing with it. Otherwise, false will be returned from this function. \sa release(), upload() @@ -481,7 +481,7 @@ bool QGLVertexBundle::bind() Releases the vertex buffer associated with this bundle from the current GL context. - This function must be called with the same QGLContext current + This function must be called with the same QOpenGLContext current as when bind() was called on the vertex buffer. \sa bind() diff --git a/src/threed/arrays/qglvertexbundle.h b/src/threed/arrays/qglvertexbundle.h index 2e4edd88f..04276bd0a 100644 --- a/src/threed/arrays/qglvertexbundle.h +++ b/src/threed/arrays/qglvertexbundle.h @@ -42,11 +42,12 @@ #ifndef QGLVERTEXBUNDLE_H #define QGLVERTEXBUNDLE_H -#include <QtOpenGL/qglbuffer.h> +#include <QOpenGLBuffer> +#include <QList> + #include "qcustomdataarray.h" #include "qglattributevalue.h" #include "qglattributeset.h" -#include <QtCore/qlist.h> QT_BEGIN_HEADER @@ -57,7 +58,7 @@ QT_MODULE(Qt3D) class QGLVertexBundlePrivate; class QGLPainter; class QGLAbstractEffect; -class QGLShaderProgram; +class QOpenGLShaderProgram; class Q_QT3D_EXPORT QGLVertexBundle { @@ -91,7 +92,7 @@ public: bool upload(); bool isUploaded() const; - QGLBuffer buffer() const; + QOpenGLBuffer buffer() const; bool bind(); void release(); diff --git a/src/threed/arrays/qglvertexbundle_p.h b/src/threed/arrays/qglvertexbundle_p.h index e0f28d80e..b59f18152 100644 --- a/src/threed/arrays/qglvertexbundle_p.h +++ b/src/threed/arrays/qglvertexbundle_p.h @@ -193,7 +193,7 @@ class QGLVertexBundlePrivate public: QGLVertexBundlePrivate() : ref(1), - buffer(QGLBuffer::VertexBuffer), + buffer(QOpenGLBuffer::VertexBuffer), vertexCount(0) { } ~QGLVertexBundlePrivate() @@ -202,7 +202,7 @@ public: } QAtomicInt ref; - QGLBuffer buffer; + QOpenGLBuffer buffer; QList<QGLVertexBundleAttribute *> attributes; int vertexCount; QGLAttributeSet attributeSet; diff --git a/src/threed/effects/qglcolladafxeffect.cpp b/src/threed/effects/qglcolladafxeffect.cpp index 6c73f053b..aee7fe74e 100644 --- a/src/threed/effects/qglcolladafxeffect.cpp +++ b/src/threed/effects/qglcolladafxeffect.cpp @@ -44,7 +44,7 @@ #include <QFile> #include <QDebug> #include <QImage> -#include "qgl.h" + #include "qgltexture2d.h" #include "qglcolladafxeffect.h" #include "qglcolladafxeffect_p.h" @@ -138,7 +138,7 @@ inline void QGLColladaFxEffectPrivate::updateMaterialChannelSnippets(QString cha -inline void QGLColladaFxEffectPrivate::setTextureUniform(QGLShaderProgram *program, QGLPainter* painter, QString channelName, QGLTexture2D* texture, int* textureUnit, QColor fallbackColor) +inline void QGLColladaFxEffectPrivate::setTextureUniform(QOpenGLShaderProgram *program, QGLPainter* painter, QString channelName, QGLTexture2D* texture, int* textureUnit, QColor fallbackColor) { QString qVariableName = QLatin1String("q") + channelName; diff --git a/src/threed/effects/qglcolladafxeffect.h b/src/threed/effects/qglcolladafxeffect.h index a300393c4..db871314b 100644 --- a/src/threed/effects/qglcolladafxeffect.h +++ b/src/threed/effects/qglcolladafxeffect.h @@ -44,7 +44,8 @@ #include <QStack> #include <QList> -#include <QGLShaderProgram> +#include <QOpenGLShaderProgram> + #include "qglshaderprogrameffect.h" QT_BEGIN_NAMESPACE diff --git a/src/threed/effects/qglcolladafxeffect_p.h b/src/threed/effects/qglcolladafxeffect_p.h index d0b58aacd..67209853b 100644 --- a/src/threed/effects/qglcolladafxeffect_p.h +++ b/src/threed/effects/qglcolladafxeffect_p.h @@ -62,7 +62,7 @@ QT_BEGIN_NAMESPACE class QGLPainter; -class QGLShaderProgram; +class QOpenGLShaderProgram; class QGLMaterial; class QGLColladaFxEffectPrivate @@ -74,7 +74,7 @@ public: void addMaterialChannelsToShaderSnippets(const QGLMaterial *material); void resetGlueSnippets(); - void setTextureUniform(QGLShaderProgram *program, QGLPainter* painter, QString channelName, QGLTexture2D* texture, int* textureUnit, QColor fallbackColor); + void setTextureUniform(QOpenGLShaderProgram *program, QGLPainter* painter, QString channelName, QGLTexture2D* texture, int* textureUnit, QColor fallbackColor); void updateMaterialChannelSnippets(QString channelName, QGLTexture2D* texture, int* textureUnit, QColor fallbackColor); QString id; diff --git a/src/threed/effects/qglcolladafxeffectfactory.cpp b/src/threed/effects/qglcolladafxeffectfactory.cpp index c9a28956d..5b17dbce3 100644 --- a/src/threed/effects/qglcolladafxeffectfactory.cpp +++ b/src/threed/effects/qglcolladafxeffectfactory.cpp @@ -45,11 +45,9 @@ #include <QTime> #include <QDir> #include "qgltexture2d.h" -#include "qgl.h" #include "qglcolladafxeffect.h" #include "qglcolladafxeffectfactory.h" -//#include "qglcolladafxeffectfactory_p.h" #include "qglcolladafxeffect_p.h" QT_BEGIN_NAMESPACE diff --git a/src/threed/effects/qglcolladafxeffectfactory.h b/src/threed/effects/qglcolladafxeffectfactory.h index f5bc0997e..478fd6a82 100644 --- a/src/threed/effects/qglcolladafxeffectfactory.h +++ b/src/threed/effects/qglcolladafxeffectfactory.h @@ -45,9 +45,8 @@ #include <QVector> #include <QXmlStreamReader> #include <QDir> -#include "qgl.h" -#include "qgltexture2d.h" +#include "qgltexture2d.h" #include "qglcolladafxeffect.h" Q_DECLARE_METATYPE(QArray<float>) diff --git a/src/threed/effects/qglflatcoloreffect.cpp b/src/threed/effects/qglflatcoloreffect.cpp index ff07452dd..40f45e6bb 100644 --- a/src/threed/effects/qglflatcoloreffect.cpp +++ b/src/threed/effects/qglflatcoloreffect.cpp @@ -41,7 +41,8 @@ #include "qglflatcoloreffect_p.h" #include "qglabstracteffect_p.h" -#include <QtOpenGL/qglshaderprogram.h> + +#include <QOpenGLShaderProgram> QT_BEGIN_NAMESPACE @@ -74,7 +75,7 @@ public: { } - QGLShaderProgram *program; + QOpenGLShaderProgram *program; int matrixUniform; int colorUniform; bool isFixedFunction; @@ -142,15 +143,15 @@ void QGLFlatColorEffect::setActive(QGLPainter *painter, bool flag) " gl_FragColor = color;\n" "}\n"; - QGLShaderProgram *program = + QOpenGLShaderProgram *program = painter->cachedProgram(QLatin1String("qt.color.flat")); d->program = program; if (!program) { if (!flag) return; - program = new QGLShaderProgram(); - program->addShaderFromSourceCode(QGLShader::Vertex, flatColorVertexShader); - program->addShaderFromSourceCode(QGLShader::Fragment, flatColorFragmentShader); + program = new QOpenGLShaderProgram; + program->addShaderFromSourceCode(QOpenGLShader::Vertex, flatColorVertexShader); + program->addShaderFromSourceCode(QOpenGLShader::Fragment, flatColorFragmentShader); program->bindAttributeLocation("vertex", QGL::Position); if (!program->link()) { qWarning("QGLFlatColorEffect::setActive(): could not link shader program"); @@ -219,7 +220,7 @@ public: { } - QGLShaderProgram *program; + QOpenGLShaderProgram *program; int matrixUniform; bool isFixedFunction; }; @@ -287,15 +288,15 @@ void QGLPerVertexColorEffect::setActive(QGLPainter *painter, bool flag) " gl_FragColor = qColor;\n" "}\n"; - QGLShaderProgram *program = + QOpenGLShaderProgram *program = painter->cachedProgram(QLatin1String("qt.color.pervertex")); d->program = program; if (!program) { if (!flag) return; - program = new QGLShaderProgram(); - program->addShaderFromSourceCode(QGLShader::Vertex, pvColorVertexShader); - program->addShaderFromSourceCode(QGLShader::Fragment, pvColorFragmentShader); + program = new QOpenGLShaderProgram(); + program->addShaderFromSourceCode(QOpenGLShader::Vertex, pvColorVertexShader); + program->addShaderFromSourceCode(QOpenGLShader::Fragment, pvColorFragmentShader); program->bindAttributeLocation("vertex", QGL::Position); program->bindAttributeLocation("color", QGL::Color); if (!program->link()) { diff --git a/src/threed/effects/qglflattextureeffect.cpp b/src/threed/effects/qglflattextureeffect.cpp index 4c7c500ba..d2eeb3189 100644 --- a/src/threed/effects/qglflattextureeffect.cpp +++ b/src/threed/effects/qglflattextureeffect.cpp @@ -42,7 +42,8 @@ #include "qglflattextureeffect_p.h" #include "qglabstracteffect_p.h" #include "qglext_p.h" -#include <QtOpenGL/qglshaderprogram.h> + +#include <QOpenGLShaderProgram> QT_BEGIN_NAMESPACE @@ -74,7 +75,7 @@ public: { } - QGLShaderProgram *program; + QOpenGLShaderProgram *program; int matrixUniform; bool isFixedFunction; }; @@ -167,15 +168,15 @@ void QGLFlatTextureEffect::setActive(QGLPainter *painter, bool flag) return; } #endif - QGLShaderProgram *program = + QOpenGLShaderProgram *program = painter->cachedProgram(QLatin1String("qt.texture.flat.replace")); d->program = program; if (!program) { if (!flag) return; - program = new QGLShaderProgram(); - program->addShaderFromSourceCode(QGLShader::Vertex, flatTexVertexShader); - program->addShaderFromSourceCode(QGLShader::Fragment, flatTexFragmentShader); + program = new QOpenGLShaderProgram(); + program->addShaderFromSourceCode(QOpenGLShader::Vertex, flatTexVertexShader); + program->addShaderFromSourceCode(QOpenGLShader::Fragment, flatTexFragmentShader); program->bindAttributeLocation("vertex", QGL::Position); program->bindAttributeLocation("texcoord", QGL::TextureCoord0); if (!program->link()) { @@ -240,7 +241,7 @@ public: { } - QGLShaderProgram *program; + QOpenGLShaderProgram *program; int matrixUniform; int colorUniform; bool isFixedFunction; @@ -300,15 +301,15 @@ void QGLFlatDecalTextureEffect::setActive(QGLPainter *painter, bool flag) } } #endif - QGLShaderProgram *program = + QOpenGLShaderProgram *program = painter->cachedProgram(QLatin1String("qt.texture.flat.decal")); d->program = program; if (!program) { if (!flag) return; - program = new QGLShaderProgram(); - program->addShaderFromSourceCode(QGLShader::Vertex, flatTexVertexShader); - program->addShaderFromSourceCode(QGLShader::Fragment, flatDecalFragmentShader); + program = new QOpenGLShaderProgram(); + program->addShaderFromSourceCode(QOpenGLShader::Vertex, flatTexVertexShader); + program->addShaderFromSourceCode(QOpenGLShader::Fragment, flatDecalFragmentShader); program->bindAttributeLocation("vertex", QGL::Position); program->bindAttributeLocation("texcoord", QGL::TextureCoord0); if (!program->link()) { diff --git a/src/threed/effects/qgllitmaterialeffect.cpp b/src/threed/effects/qgllitmaterialeffect.cpp index 8450162ca..1b2216c51 100644 --- a/src/threed/effects/qgllitmaterialeffect.cpp +++ b/src/threed/effects/qgllitmaterialeffect.cpp @@ -42,8 +42,9 @@ #include "qgllitmaterialeffect_p.h" #include "qglabstracteffect_p.h" #include "qglext_p.h" -#include <QtOpenGL/qglshaderprogram.h> -#include <QtCore/qfile.h> + +#include <QOpenGLShaderProgram> +#include <QFile> QT_BEGIN_NAMESPACE @@ -319,7 +320,7 @@ public: { } - QGLShaderProgram *program; + QOpenGLShaderProgram *program; int matrixUniform; int modelViewUniform; int normalMatrixUniform; @@ -421,14 +422,14 @@ void QGLLitMaterialEffect::setActive(QGLPainter *painter, bool flag) return; } #endif - QGLShaderProgram *program = painter->cachedProgram(d->programName); + QOpenGLShaderProgram *program = painter->cachedProgram(d->programName); d->program = program; if (!program) { if (!flag) return; - program = new QGLShaderProgram(); - program->addShaderFromSourceCode(QGLShader::Vertex, createVertexSource(litMaterialLightingShader, d->vertexShader)); - program->addShaderFromSourceCode(QGLShader::Fragment, d->fragmentShader); + program = new QOpenGLShaderProgram; + program->addShaderFromSourceCode(QOpenGLShader::Vertex, createVertexSource(litMaterialLightingShader, d->vertexShader)); + program->addShaderFromSourceCode(QOpenGLShader::Fragment, d->fragmentShader); program->bindAttributeLocation("vertex", QGL::Position); program->bindAttributeLocation("normal", QGL::Normal); if (d->textureMode != 0) @@ -494,7 +495,7 @@ void QGLLitMaterialEffect::update return; } #endif - QGLShaderProgram *program = d->program; + QOpenGLShaderProgram *program = d->program; if ((updates & QGLPainter::UpdateMatrices) != 0) { program->setUniformValue(d->matrixUniform, painter->combinedMatrix()); program->setUniformValue(d->modelViewUniform, painter->modelViewMatrix()); diff --git a/src/threed/effects/qglshaderprogrameffect.cpp b/src/threed/effects/qglshaderprogrameffect.cpp index 4c86ce190..5571540c6 100644 --- a/src/threed/effects/qglshaderprogrameffect.cpp +++ b/src/threed/effects/qglshaderprogrameffect.cpp @@ -41,8 +41,9 @@ #include "qglshaderprogrameffect.h" #include "qglabstracteffect_p.h" -#include <QtOpenGL/qglshaderprogram.h> -#include <QtCore/qfile.h> + +#include <QOpenGLShaderProgram> +#include <QFile> QT_BEGIN_NAMESPACE @@ -477,7 +478,7 @@ public: bool regenerate; bool fixedFunction; #if !defined(QGL_FIXED_FUNCTION_ONLY) - QGLShaderProgram *program; + QOpenGLShaderProgram *program; int matrix; int mvMatrix; int projMatrix; @@ -641,9 +642,9 @@ void QGLShaderProgramEffectPrivate::setMaterial Constructs a new shader program effect. This constructor is typically followed by calls to setVertexShader() and setFragmentShader(). - Note that a shader program effect will be bound to the QGLContext that + Note that a shader program effect will be bound to the QOpenGLContext that is current when setActive() is called for the first time. After that, - the effect can only be used with that context or any other QGLContext + the effect can only be used with that context or any other QOpenGLContext that shares with it. */ QGLShaderProgramEffect::QGLShaderProgramEffect() @@ -702,15 +703,15 @@ void QGLShaderProgramEffect::setActive(QGLPainter *painter, bool flag) return; Q_ASSERT(!d->vertexShader.isEmpty()); Q_ASSERT(!d->fragmentShader.isEmpty()); - d->program = new QGLShaderProgram(); + d->program = new QOpenGLShaderProgram; d->program->addShaderFromSourceCode - (QGLShader::Vertex, d->vertexShader); + (QOpenGLShader::Vertex, d->vertexShader); d->program->addShaderFromSourceCode - (QGLShader::Fragment, d->fragmentShader); + (QOpenGLShader::Fragment, d->fragmentShader); if (!d->geometryShader.isEmpty()) { d->program->addShaderFromSourceCode - (QGLShader::Geometry, d->geometryShader); + (QOpenGLShader::Geometry, d->geometryShader); d->program->setGeometryInputType(d->geometryInputType); d->program->setGeometryOutputType(d->geometryOutputType); @@ -1081,7 +1082,7 @@ void QGLShaderProgramEffect::setMaximumLights(int value) effect->program()->setUniformValue("springiness", GLfloat(0.5f)); \endcode */ -QGLShaderProgram *QGLShaderProgramEffect::program() const +QOpenGLShaderProgram *QGLShaderProgramEffect::program() const { #if !defined(QGL_FIXED_FUNCTION_ONLY) Q_D(const QGLShaderProgramEffect); diff --git a/src/threed/effects/qglshaderprogrameffect.h b/src/threed/effects/qglshaderprogrameffect.h index 83740a14c..bea505974 100644 --- a/src/threed/effects/qglshaderprogrameffect.h +++ b/src/threed/effects/qglshaderprogrameffect.h @@ -49,7 +49,7 @@ QT_BEGIN_HEADER QT_BEGIN_NAMESPACE class QGLShaderProgramEffectPrivate; -class QGLShaderProgram; +class QOpenGLShaderProgram; class Q_QT3D_EXPORT QGLShaderProgramEffect : public QGLAbstractEffect { @@ -80,7 +80,7 @@ public: int maximumLights() const; void setMaximumLights(int value); - QGLShaderProgram *program() const; + QOpenGLShaderProgram *program() const; protected: virtual bool beforeLink(); diff --git a/src/threed/geometry/qgeometrydata.cpp b/src/threed/geometry/qgeometrydata.cpp index b4bf311df..9a50f514c 100644 --- a/src/threed/geometry/qgeometrydata.cpp +++ b/src/threed/geometry/qgeometrydata.cpp @@ -43,8 +43,7 @@ #include "qlogicalvertex.h" #include "qglpainter.h" -#include <QtOpenGL/qgl.h> -#include <QtCore/qdebug.h> +#include <QDebug> QT_BEGIN_NAMESPACE diff --git a/src/threed/geometry/qglbuilder.h b/src/threed/geometry/qglbuilder.h index 792e0ac7c..0930257bb 100644 --- a/src/threed/geometry/qglbuilder.h +++ b/src/threed/geometry/qglbuilder.h @@ -42,10 +42,9 @@ #ifndef QGLBuilder_H #define QGLBuilder_H -#include <QtCore/qvector.h> -#include <QtCore/qlist.h> -#include <QtGui/qvector3d.h> -#include <QtOpenGL/qgl.h> +#include <QVector> +#include <QList> +#include <QVector3D> #include "qglnamespace.h" #include "qglscenenode.h" diff --git a/src/threed/geometry/qglsection_p.h b/src/threed/geometry/qglsection_p.h index 8da4079d8..1a5edc5b9 100644 --- a/src/threed/geometry/qglsection_p.h +++ b/src/threed/geometry/qglsection_p.h @@ -58,8 +58,7 @@ #include "qbox3d.h" #include "qglnamespace.h" -#include <QtOpenGL/qgl.h> -#include <QtGui/qmatrix4x4.h> +#include <QMatrix4x4> QT_BEGIN_NAMESPACE diff --git a/src/threed/global/qglnamespace.h b/src/threed/global/qglnamespace.h index 682b0ab1f..801ce2fd7 100644 --- a/src/threed/global/qglnamespace.h +++ b/src/threed/global/qglnamespace.h @@ -102,10 +102,7 @@ namespace QGL enum TextureWrap { Repeat = 0x2901, // GL_REPEAT - Clamp = 0x2900, // GL_CLAMP - ClampToBorder = 0x812D, // GL_CLAMP_TO_BORDER - ClampToEdge = 0x812F, // GL_CLAMP_TO_EDGE - MirroredRepeat = 0x8370 // GL_MIRRORED_REPEAT + ClampToEdge = 0x812F // GL_CLAMP_TO_EDGE }; enum Eye diff --git a/src/threed/graphicsview/graphicsview.pri b/src/threed/graphicsview/graphicsview.pri index b43dbe662..db3aa7108 100644 --- a/src/threed/graphicsview/graphicsview.pri +++ b/src/threed/graphicsview/graphicsview.pri @@ -3,19 +3,25 @@ INCLUDEPATH += $$PWD VPATH += $$PWD HEADERS += \ - graphicsview/qglgraphicsviewportitem.h \ graphicsview/qgraphicsbillboardtransform.h \ - graphicsview/qgraphicsembedscene.h \ graphicsview/qgraphicsrotation3d.h \ graphicsview/qgraphicsscale3d.h \ graphicsview/qgraphicstransform3d.h \ graphicsview/qgraphicstranslation3d.h SOURCES += \ - qglgraphicsviewportitem.cpp \ qgraphicsbillboardtransform.cpp \ - qgraphicsembedscene.cpp \ qgraphicsrotation3d.cpp \ qgraphicsscale3d.cpp \ qgraphicstransform3d.cpp \ qgraphicstranslation3d.cpp + +# This requires desktop stuff +!isEmpty(QT.widgets.name): !isEmpty(QT.opengl.name) { + HEADERS += \ + graphicsview/qglgraphicsviewportitem.h \ + graphicsview/qgraphicsembedscene.h + SOURCES += \ + qglgraphicsviewportitem.cpp \ + qgraphicsembedscene.cpp +} diff --git a/src/threed/graphicsview/qgraphicsembedscene.cpp b/src/threed/graphicsview/qgraphicsembedscene.cpp index 13a6741b5..9eb20130f 100644 --- a/src/threed/graphicsview/qgraphicsembedscene.cpp +++ b/src/threed/graphicsview/qgraphicsembedscene.cpp @@ -41,12 +41,14 @@ #include "qgraphicsembedscene.h" #include "qglnamespace.h" -#include <QtOpenGL/qglframebufferobject.h> -#include <QtWidgets/qapplication.h> -#include <QtGui/qpainter.h> -#include <QtGui/qevent.h> -#include <QtWidgets/qgraphicssceneevent.h> -#include <QtCore/qdebug.h> + +#include <QGLFramebufferObject> +#include <QGuiApplication> +#include <QPainter> +#include <QEvent> +#include <QMouseEvent> +#include <QGraphicsSceneEvent> +#include <QDebug> QT_BEGIN_NAMESPACE @@ -368,7 +370,7 @@ void QGraphicsEmbedScene::deliverEvent(QEvent *event, const QPointF &texCoord) e.setButton(ev->button()); e.setModifiers(ev->modifiers()); e.setAccepted(false); - QApplication::sendEvent(this, &e); + QGuiApplication::sendEvent(this, &e); } break; @@ -385,7 +387,7 @@ void QGraphicsEmbedScene::deliverEvent(QEvent *event, const QPointF &texCoord) e.setDelta(ev->delta()); e.setOrientation(ev->orientation()); e.setAccepted(false); - QApplication::sendEvent(this, &e); + QGuiApplication::sendEvent(this, &e); } break; #endif @@ -416,7 +418,7 @@ void QGraphicsEmbedScene::deliverEvent(QEvent *event, const QPointF &texCoord) e.setButton(ev->button()); e.setModifiers(ev->modifiers()); e.setAccepted(false); - QApplication::sendEvent(this, &e); + QGuiApplication::sendEvent(this, &e); } break; @@ -432,7 +434,7 @@ void QGraphicsEmbedScene::deliverEvent(QEvent *event, const QPointF &texCoord) e.setDelta(ev->delta()); e.setOrientation(ev->orientation()); e.setAccepted(false); - QApplication::sendEvent(this, &e); + QGuiApplication::sendEvent(this, &e); } break; #endif @@ -440,7 +442,7 @@ void QGraphicsEmbedScene::deliverEvent(QEvent *event, const QPointF &texCoord) default: { // Send the event directly without any conversion. // Typically used for keyboard, focus, and enter/leave events. - QApplication::sendEvent(this, event); + QGuiApplication::sendEvent(this, event); } break; diff --git a/src/threed/graphicsview/qgraphicsembedscene.h b/src/threed/graphicsview/qgraphicsembedscene.h index 9d8f6d265..a51ae661a 100644 --- a/src/threed/graphicsview/qgraphicsembedscene.h +++ b/src/threed/graphicsview/qgraphicsembedscene.h @@ -43,8 +43,10 @@ #define QGRAPHICSEMBEDSCENE_H #include "qglnamespace.h" -#include <QtWidgets/qgraphicsscene.h> -#include <QtOpenGL/qgl.h> + +#include <QGraphicsScene> +#include <QGLBuffer> +#include <QGLFramebufferObjectFormat> QT_BEGIN_HEADER diff --git a/src/threed/painting/painting.pri b/src/threed/painting/painting.pri index 27763c09e..bd9fc0075 100644 --- a/src/threed/painting/painting.pri +++ b/src/threed/painting/painting.pri @@ -22,8 +22,5 @@ PRIVATE_HEADERS += \ qglpainter_p.h \ qglpickcolors_p.h \ qglabstracteffect_p.h \ - qmatrix4x4stack_p.h - -# Don't add this file to PRIVATE_HEADERS because we don't -# want moc to run over it: -# qglext_p.h + qmatrix4x4stack_p.h \ + qglext_p.h diff --git a/src/threed/painting/qglabstracteffect.cpp b/src/threed/painting/qglabstracteffect.cpp index dfc2c9a18..573a90fc6 100644 --- a/src/threed/painting/qglabstracteffect.cpp +++ b/src/threed/painting/qglabstracteffect.cpp @@ -41,7 +41,7 @@ #include "qglabstracteffect.h" #include "qglpainter_p.h" -#include <QtOpenGL/qglshaderprogram.h> +#include <QOpenGLShaderProgram> QT_BEGIN_NAMESPACE diff --git a/src/threed/painting/qglext.cpp b/src/threed/painting/qglext.cpp index 7e54cf715..57abeb5af 100644 --- a/src/threed/painting/qglext.cpp +++ b/src/threed/painting/qglext.cpp @@ -55,8 +55,8 @@ typedef void (QOPENGLF_APIENTRYP q_PFNGLCLIENTACTIVETEXTUREPROC) (GLenum); class QGLMultiTextureExtensions : public QOpenGLSharedResource { public: - QGLMultiTextureExtensions(const QGLContext *ctx) - : QOpenGLSharedResource(ctx ? ctx->contextHandle()->shareGroup() : 0) + QGLMultiTextureExtensions(const QOpenGLContext *ctx) + : QOpenGLSharedResource(ctx ? ctx->shareGroup() : 0) { clientActiveTexture = 0; @@ -80,19 +80,21 @@ QGLMultiTextureExtensions::~QGLMultiTextureExtensions() } static QGLMultiTextureExtensions *resolveMultiTextureExtensions - (const QGLContext *ctx) + (const QOpenGLContext *ctx) { if (!qt_multitexture_funcs) qt_multitexture_funcs = new QGLMultiTextureExtensions(ctx); if (!(qt_multitexture_funcs->multiTextureResolved)) { qt_multitexture_funcs->multiTextureResolved = true; if (!qt_multitexture_funcs->clientActiveTexture) { + QOpenGLContext *vctx = const_cast<QOpenGLContext*>(ctx); qt_multitexture_funcs->clientActiveTexture = (q_PFNGLCLIENTACTIVETEXTUREPROC) - ctx->getProcAddress(QLatin1String("glClientActiveTexture")); + vctx->getProcAddress("glClientActiveTexture"); } if (!qt_multitexture_funcs->clientActiveTexture) { + QOpenGLContext *vctx = const_cast<QOpenGLContext*>(ctx); qt_multitexture_funcs->clientActiveTexture = (q_PFNGLCLIENTACTIVETEXTUREPROC) - ctx->getProcAddress(QLatin1String("glClientActiveTextureARB")); + vctx->getProcAddress("glClientActiveTextureARB"); } } return qt_multitexture_funcs; @@ -100,7 +102,7 @@ static QGLMultiTextureExtensions *resolveMultiTextureExtensions void qt_gl_ClientActiveTexture(GLenum texture) { - const QGLContext *ctx = QGLContext::currentContext(); + const QOpenGLContext *ctx = QOpenGLContext::currentContext(); if (!ctx) return; QGLMultiTextureExtensions *extn = resolveMultiTextureExtensions(ctx); diff --git a/src/threed/painting/qglext_p.h b/src/threed/painting/qglext_p.h index 4d8ad9907..bcad67fdc 100644 --- a/src/threed/painting/qglext_p.h +++ b/src/threed/painting/qglext_p.h @@ -53,7 +53,10 @@ // We mean it. // -#include <QtOpenGL/qgl.h> +#include <QOpenGLBuffer> +#include <QtGlobal> +#include <QByteArray> + #include "qt3dglobal.h" QT_BEGIN_HEADER @@ -110,66 +113,6 @@ private: // Copy of some definitions from <QtOpenGL/private/qgl_p.h> so that // we can avoid a direct dependency upon private headers in Qt. -#if QT_VERSION >= 0x040800 -#else - -#if !defined(QGL_P_H) - -class Q_OPENGL_EXPORT QGLContextResource -{ -public: - typedef void (*FreeFunc)(void *); - QGLContextResource(FreeFunc f); - ~QGLContextResource(); - void insert(const QGLContext *key, void *value); - void *value(const QGLContext *key); - void cleanup(const QGLContext *ctx, void *value); -private: - FreeFunc free; - QAtomicInt active; -}; - -#endif - -template <class T> -class QGLResource : public QGLContextResource -{ -public: - static void freeResource(void *resource) { - delete reinterpret_cast<T *>(resource); - } - - QGLResource() : QGLContextResource(freeResource) {} - - T *value(const QGLContext *context) { - T *resource = reinterpret_cast<T *>(QGLContextResource::value(context)); - if (!resource) { - resource = new T(context); - insert(context, resource); - } - return resource; - } -}; - -#endif - -#if !defined(QGL_P_H) && !defined(Q_MOC_RUN) - -class Q_OPENGL_EXPORT QGLSignalProxy : public QObject -{ - Q_OBJECT -public: - QGLSignalProxy() : QObject() {} - void emitAboutToDestroyContext(const QGLContext *context) { - emit aboutToDestroyContext(context); - } - static QGLSignalProxy *instance(); -Q_SIGNALS: - void aboutToDestroyContext(const QGLContext *context); -}; - -#endif - QT_END_NAMESPACE QT_END_HEADER diff --git a/src/threed/painting/qglpainter.cpp b/src/threed/painting/qglpainter.cpp index 1b9cd284e..59ab40f04 100644 --- a/src/threed/painting/qglpainter.cpp +++ b/src/threed/painting/qglpainter.cpp @@ -43,19 +43,25 @@ #include "qglpainter_p.h" #include "qglabstracteffect.h" #include "qglext_p.h" -#include <QtGui/QOpenGLContext> - -#include <QtOpenGL/qglpixelbuffer.h> -#include <QtOpenGL/qglshaderprogram.h> -#include <QtOpenGL/qglframebufferobject.h> -#include <QtGui/qpainter.h> -#include <QtGui/qpaintengine.h> -#include <QtCore/qvarlengtharray.h> -#include <QtCore/qmap.h> + +#include <QOpenGLContext> +#include <QOpenGLShaderProgram> +#include <QOpenGLFramebufferObject> +#include <QPainter> +#include <QPaintEngine> +#include <QVarLengthArray> +#include <QMap> + +#ifdef QT_OPENGL_LIB +#include <QGLPixelBuffer> +#include "qglpixelbuffersurface.h" +#endif + #if !defined(QT_NO_THREAD) -#include <QtCore/qthreadstorage.h> -#include <QtCore/QThread> +#include <QThreadStorage> +#include <QThread> #endif + #include "qglflatcoloreffect_p.h" #include "qglflattextureeffect_p.h" #include "qgllitmaterialeffect_p.h" @@ -67,7 +73,6 @@ #include "qglvertexbundle_p.h" #include "qmatrix4x4stack_p.h" #include "qglwindowsurface.h" -#include "qglpixelbuffersurface.h" #include "qglpaintersurface_p.h" #undef glActiveTexture @@ -166,7 +171,7 @@ QGLPainterPickPrivate::~QGLPainterPickPrivate() #if !defined(QT_NO_THREAD) -// QGLContext's are thread-specific, so QGLPainterPrivateCache should be too. +// QOpenGLContext's are thread-specific, so QGLPainterPrivateCache should be too. typedef QThreadStorage<QGLPainterPrivateCache *> QGLPainterPrivateStorage; Q_GLOBAL_STATIC(QGLPainterPrivateStorage, painterPrivateStorage) @@ -464,7 +469,7 @@ bool QGLPainter::begin(QGLAbstractSurface *surface) false if this painter was not bound to a GL context. The GL context that was bound to this painter will not have - QGLContext::doneCurrent() called on it. It is the responsibility + QOpenGLContext::doneCurrent() called on it. It is the responsibility of the caller to terminate context operations. The effect() will be left active in the GL context and will be @@ -485,11 +490,11 @@ bool QGLPainter::end() // Unbind the current vertex and index buffers. if (d->boundVertexBuffer) { - QGLBuffer::release(QGLBuffer::VertexBuffer); + QOpenGLBuffer::release(QOpenGLBuffer::VertexBuffer); d->boundVertexBuffer = 0; } if (d->boundIndexBuffer) { - QGLBuffer::release(QGLBuffer::IndexBuffer); + QOpenGLBuffer::release(QOpenGLBuffer::IndexBuffer); d->boundIndexBuffer = 0; } @@ -1018,7 +1023,7 @@ void QGLPainter::disableEffect() \sa setCachedProgram() */ -QGLShaderProgram *QGLPainter::cachedProgram(const QString& name) const +QOpenGLShaderProgram *QGLPainter::cachedProgram(const QString& name) const { Q_D(const QGLPainter); QGLPAINTER_CHECK_PRIVATE(); @@ -1043,11 +1048,11 @@ QGLShaderProgram *QGLPainter::cachedProgram(const QString& name) const \sa cachedProgram() */ void QGLPainter::setCachedProgram - (const QString& name, QGLShaderProgram *program) + (const QString& name, QOpenGLShaderProgram *program) { Q_D(QGLPainter); QGLPAINTER_CHECK_PRIVATE(); - QGLShaderProgram *current = d->cachedPrograms.value(name, 0); + QOpenGLShaderProgram *current = d->cachedPrograms.value(name, 0); if (current != program) { if (program) d->cachedPrograms[name] = program; @@ -1264,7 +1269,7 @@ void QGLPainter::setVertexAttribute QGLPAINTER_CHECK_PRIVATE(); d->ensureEffect(this); if (d->boundVertexBuffer) { - QGLBuffer::release(QGLBuffer::VertexBuffer); + QOpenGLBuffer::release(QOpenGLBuffer::VertexBuffer); d->boundVertexBuffer = 0; } if (d->isFixedFunction) { @@ -1308,7 +1313,7 @@ void QGLPainter::setVertexBundle(const QGLVertexBundle& buffer) d->boundVertexBuffer = id; } } else if (d->boundVertexBuffer) { - QGLBuffer::release(QGLBuffer::VertexBuffer); + QOpenGLBuffer::release(QOpenGLBuffer::VertexBuffer); d->boundVertexBuffer = 0; } for (int index = 0; index < bd->attributes.size(); ++index) { @@ -1619,7 +1624,7 @@ void QGLPainter::draw(QGL::DrawingMode mode, const ushort *indices, int count) QGLPAINTER_CHECK_PRIVATE(); update(); if (d->boundIndexBuffer) { - QGLBuffer::release(QGLBuffer::IndexBuffer); + QOpenGLBuffer::release(QOpenGLBuffer::IndexBuffer); d->boundIndexBuffer = 0; } glDrawElements(GLenum(mode), count, GL_UNSIGNED_SHORT, indices); diff --git a/src/threed/painting/qglpainter.h b/src/threed/painting/qglpainter.h index aa1f3a18e..b0c3e43eb 100644 --- a/src/threed/painting/qglpainter.h +++ b/src/threed/painting/qglpainter.h @@ -42,12 +42,14 @@ #ifndef QGLPAINTER_H #define QGLPAINTER_H -#include <QtOpenGL/qgl.h> #include "qglnamespace.h" -#include <QtGui/qvector2d.h> -#include <QtGui/qvector3d.h> -#include <QtGui/qvector4d.h> -#include <QtGui/qmatrix4x4.h> + +#include <QVector2D> +#include <QVector3D> +#include <QVector4D> +#include <QMatrix4x4> +#include <QPainter> + #include "qbox3d.h" #include "qopenglfunctions.h" #include "qglvertexbundle.h" @@ -73,8 +75,8 @@ class QGLPainterPrivate; class QGLTexture2D; class QGLTextureCube; class QGeometryData; -class QGLShaderProgram; -class QGLFramebufferObject; +class QOpenGLShaderProgram; +class QOpenGLFramebufferObject; class QGLSceneNode; class QGLRenderSequencer; class QGLAbstractSurface; @@ -145,8 +147,8 @@ public: void disableEffect(); - QGLShaderProgram *cachedProgram(const QString& name) const; - void setCachedProgram(const QString& name, QGLShaderProgram *program); + QOpenGLShaderProgram *cachedProgram(const QString& name) const; + void setCachedProgram(const QString& name, QOpenGLShaderProgram *program); QColor color() const; void setColor(const QColor& color); diff --git a/src/threed/painting/qglpainter_p.h b/src/threed/painting/qglpainter_p.h index d8038908a..b174a4651 100644 --- a/src/threed/painting/qglpainter_p.h +++ b/src/threed/painting/qglpainter_p.h @@ -117,7 +117,7 @@ public: QColor color; QGLPainter::Updates updates; QGLPainterPickPrivate *pick; - QMap<QString, QGLShaderProgram *> cachedPrograms; + QMap<QString, QOpenGLShaderProgram *> cachedPrograms; QStack<QGLPainterSurfaceInfo> surfaceStack; GLuint boundVertexBuffer; GLuint boundIndexBuffer; diff --git a/src/threed/surfaces/qglabstractsurface.cpp b/src/threed/surfaces/qglabstractsurface.cpp index 1c32ad059..81ea2eb8e 100644 --- a/src/threed/surfaces/qglabstractsurface.cpp +++ b/src/threed/surfaces/qglabstractsurface.cpp @@ -42,16 +42,19 @@ #include "qglabstractsurface.h" #include "qglcontextsurface_p.h" #include "qglframebufferobjectsurface.h" -#include "qglpixelbuffersurface.h" #include "qglsubsurface.h" #include "qglwindowsurface.h" -#include <QtCore/QtDebug> -#include <QtGui/QWindow> -#include <QtGui/QOpenGLFramebufferObject> -#include <QtOpenGL/QGLPixelBuffer> -#include <QtGui/QOpenGLContext> -#include <QtGui/QSurface> +#include <QDebug> +#include <QWindow> +#include <QOpenGLFramebufferObject> +#include <QOpenGLContext> +#include <QSurface> + +#ifdef QT_OPENGL_LIB +#include <QGLPixelBuffer> +#include "qglpixelbuffersurface.h" +#endif QT_BEGIN_NAMESPACE @@ -69,9 +72,12 @@ QT_BEGIN_NAMESPACE of a subsurface may be the left or right eye image of a stereoscopic pair that is rendered into the two halves of a window. + Note that pixelbuffers are only supported when Qt is built with the + OpenGL library. + Activating a surface for OpenGL drawing, and deactivating it afterwards can be quite varied across surface types. Sometimes it is enough - to just make a QGLContext current and set the \c{glViewport()}. + to just make a QOpenGLContext current and set the \c{glViewport()}. Other times a context must be made current, followed by binding a framebuffer object, and finally setting the \c{glViewport()}. @@ -126,7 +132,9 @@ QGLAbstractSurface::QGLAbstractSurface(int surfaceType) : m_context(0) , m_window(0) , m_fbo(0) +#ifdef QT_OPENGL_LIB , m_pb(0) +#endif , m_type(surfaceType) { } @@ -222,11 +230,13 @@ QRect QGLAbstractSurface::viewportRect() const Q_ASSERT(m_fbo); height = m_fbo->size().height(); } +#ifdef QT_OPENGL_LIB else if (m_type == PixelBuffer) { Q_ASSERT(m_pb); height = m_pb->size().height(); } +#endif return QRect(view.x(), height - (view.y() + view.height()), view.width(), view.height()); diff --git a/src/threed/surfaces/qglabstractsurface.h b/src/threed/surfaces/qglabstractsurface.h index 2bc576abe..b1f09cd70 100644 --- a/src/threed/surfaces/qglabstractsurface.h +++ b/src/threed/surfaces/qglabstractsurface.h @@ -44,7 +44,7 @@ #include "qt3dglobal.h" -#include <QtOpenGL/qgl.h> +#include <QRect> QT_BEGIN_HEADER @@ -54,7 +54,10 @@ QT_MODULE(Qt3D) class QWindow; class QOpenGLFramebufferObject; +#ifdef QT_OPENGL_LIB class QGLPixelBuffer; +#endif +class QOpenGLContext; class Q_QT3D_EXPORT QGLAbstractSurface { @@ -65,7 +68,9 @@ public: { Window, FramebufferObject, +#ifdef QT_OPENGL_LIB PixelBuffer, +#endif Subsurface, User = 1000 }; @@ -99,7 +104,9 @@ protected: QOpenGLContext *m_context; QWindow *m_window; QOpenGLFramebufferObject *m_fbo; +#ifdef QT_OPENGL_LIB QGLPixelBuffer *m_pb; +#endif private: int m_type; diff --git a/src/threed/surfaces/qgldrawbuffersurface_p.h b/src/threed/surfaces/qgldrawbuffersurface_p.h index c8759230b..385337cc2 100644 --- a/src/threed/surfaces/qgldrawbuffersurface_p.h +++ b/src/threed/surfaces/qgldrawbuffersurface_p.h @@ -55,6 +55,8 @@ #include "qglabstractsurface.h" +#include <QOpenGLBuffer> + QT_BEGIN_HEADER QT_BEGIN_NAMESPACE @@ -67,7 +69,6 @@ public: , m_surface(surface), m_buffer(buffer) {} ~QGLDrawBufferSurface() {} - QPaintDevice *device() const; bool activate(QGLAbstractSurface *prevSurface); void deactivate(QGLAbstractSurface *nextSurface); QRect viewportGL() const; diff --git a/src/threed/surfaces/qglmaskedsurface.cpp b/src/threed/surfaces/qglmaskedsurface.cpp index 977ede79f..d5cb99c56 100644 --- a/src/threed/surfaces/qglmaskedsurface.cpp +++ b/src/threed/surfaces/qglmaskedsurface.cpp @@ -41,6 +41,8 @@ #include "qglmaskedsurface_p.h" +#include <QOpenGLBuffer> + QT_BEGIN_NAMESPACE /*! diff --git a/src/threed/surfaces/qglmaskedsurface_p.h b/src/threed/surfaces/qglmaskedsurface_p.h index 51395990d..87e696c5e 100644 --- a/src/threed/surfaces/qglmaskedsurface_p.h +++ b/src/threed/surfaces/qglmaskedsurface_p.h @@ -55,6 +55,8 @@ #include "qglabstractsurface.h" +#include <QScopedPointer> + QT_BEGIN_HEADER QT_BEGIN_NAMESPACE diff --git a/src/threed/surfaces/qglpaintersurface_p.h b/src/threed/surfaces/qglpaintersurface_p.h index 083e2a598..17f4ef160 100644 --- a/src/threed/surfaces/qglpaintersurface_p.h +++ b/src/threed/surfaces/qglpaintersurface_p.h @@ -55,6 +55,8 @@ #include "qglabstractsurface.h" +#include <QPainter> + QT_BEGIN_HEADER QT_BEGIN_NAMESPACE diff --git a/src/threed/surfaces/qglpixelbuffersurface.h b/src/threed/surfaces/qglpixelbuffersurface.h index 81f7e5f87..0f047bbbc 100644 --- a/src/threed/surfaces/qglpixelbuffersurface.h +++ b/src/threed/surfaces/qglpixelbuffersurface.h @@ -43,7 +43,8 @@ #define QGLPIXELBUFFERSURFACE_H #include "qglabstractsurface.h" -#include <QtOpenGL/qglpixelbuffer.h> + +#include <QGLPixelBuffer> QT_BEGIN_HEADER diff --git a/src/threed/surfaces/qglsubsurface.h b/src/threed/surfaces/qglsubsurface.h index 39b269412..3ecbd235d 100644 --- a/src/threed/surfaces/qglsubsurface.h +++ b/src/threed/surfaces/qglsubsurface.h @@ -44,6 +44,8 @@ #include "qglabstractsurface.h" +#include <QScopedPointer> + QT_BEGIN_HEADER QT_BEGIN_NAMESPACE diff --git a/src/threed/surfaces/surfaces.pri b/src/threed/surfaces/surfaces.pri index f8095e780..ee5d78238 100644 --- a/src/threed/surfaces/surfaces.pri +++ b/src/threed/surfaces/surfaces.pri @@ -1,11 +1,13 @@ INCLUDEPATH += $$PWD + VPATH += $$PWD + HEADERS += \ surfaces/qglabstractsurface.h \ surfaces/qglframebufferobjectsurface.h \ - surfaces/qglpixelbuffersurface.h \ surfaces/qglsubsurface.h \ surfaces/qglwindowsurface.h + SOURCES += \ qglabstractsurface.cpp \ qglcontextsurface.cpp \ @@ -13,9 +15,17 @@ SOURCES += \ qglframebufferobjectsurface.cpp \ qglmaskedsurface.cpp \ qglpaintersurface.cpp \ - qglpixelbuffersurface.cpp \ qglsubsurface.cpp \ qglwindowsurface.cpp + +# This is the *desktop* opengl library, which is not supported on some +# smaller footprint systems. If this is turned off, then (for example) +# pixel-buffer objects are not supported. +!isEmpty(QT.opengl.name) { + SOURCES += qglpixelbuffersurface.cpp + HEADERS += surfaces/qglpixelbuffersurface.h +} + PRIVATE_HEADERS += \ qglcontextsurface_p.h \ qgldrawbuffersurface_p.h \ diff --git a/src/threed/textures/qglsharedresource.cpp b/src/threed/textures/qglsharedresource.cpp index a298ea06f..8f1d5ed3a 100644 --- a/src/threed/textures/qglsharedresource.cpp +++ b/src/threed/textures/qglsharedresource.cpp @@ -40,40 +40,24 @@ ****************************************************************************/ #include "qglsharedresource_p.h" -#include <QtCore/qmutex.h> -#include <QtCore/qcoreapplication.h> -#include <qopenglcontext.h> -QT_BEGIN_NAMESPACE - -#if !defined(Q_MOC_RUN) +#include <QMutex> +#include <QGuiApplication> +#include <QOpenGLContext> -class Q_OPENGL_EXPORT QGLSignalProxy : public QObject -{ - Q_OBJECT -public: - QGLSignalProxy() : QObject() {} - void emitAboutToDestroyContext(const QGLContext *context) { - emit aboutToDestroyContext(context); - } - static QGLSignalProxy *instance(); -Q_SIGNALS: - void aboutToDestroyContext(const QGLContext *context); -}; - -#endif +QT_BEGIN_NAMESPACE -class QGLContextInfo +class QOpenGLContextInfo { public: - QGLContextInfo(const QGLContext *ctx) : m_context(ctx), m_resources(0) {} - ~QGLContextInfo(); + QOpenGLContextInfo(QOpenGLContext *ctx) : m_context(ctx), m_resources(0) {} + ~QOpenGLContextInfo(); - const QGLContext *m_context; + QOpenGLContext *m_context; QGLSharedResource *m_resources; }; -QGLContextInfo::~QGLContextInfo() +QOpenGLContextInfo::~QOpenGLContextInfo() { // Detach this information block from all of the shared resources // that used to be owned by it. @@ -85,74 +69,70 @@ QGLContextInfo::~QGLContextInfo() } } -class QGLContextManager : public QObject +class QOpenGLContextManager : public QObject { Q_OBJECT public: - QGLContextManager(QObject *parent = 0); - ~QGLContextManager(); + QOpenGLContextManager(QObject *parent = 0); + ~QOpenGLContextManager(); QMutex managerLock; - QGLContextInfo *contextInfo(const QGLContext *ctx); + QOpenGLContextInfo *contextInfo(QOpenGLContext *ctx); private Q_SLOTS: - void aboutToDestroyContext(const QGLContext *ctx); + void aboutToDestroyContext(); private: - QList<QGLContextInfo *> m_contexts; + QList<QOpenGLContextInfo *> m_contexts; }; -Q_GLOBAL_STATIC(QGLContextManager, qt_gl_context_manager) +Q_GLOBAL_STATIC(QOpenGLContextManager, qt_gl_context_manager) -QGLContextManager::QGLContextManager(QObject *parent) +QOpenGLContextManager::QOpenGLContextManager(QObject *parent) : QObject(parent) { - QGLSignalProxy *proxy = QGLSignalProxy::instance(); - QThread *mainThread = qApp->thread(); - if (thread() != mainThread) { - // The manager and signal proxy have been created for the first - // time in a background thread. For safety, move both objects - // to the main thread. - moveToThread(mainThread); - proxy->moveToThread(mainThread); - } - connect(proxy, SIGNAL(aboutToDestroyContext(const QGLContext *)), - this, SLOT(aboutToDestroyContext(const QGLContext *))); } -QGLContextManager::~QGLContextManager() +QOpenGLContextManager::~QOpenGLContextManager() { QMutexLocker locker(&managerLock); qDeleteAll(m_contexts); } -QGLContextInfo *QGLContextManager::contextInfo(const QGLContext *ctx) +QOpenGLContextInfo *QOpenGLContextManager::contextInfo(QOpenGLContext *ctx) { - QGLContextInfo *info; - for (int index = 0; index < m_contexts.size(); ++index) { - info = m_contexts[index]; - if (info->m_context == ctx) - return info; + QOpenGLContextInfo *info = 0; + if (ctx) + { + for (int index = 0; index < m_contexts.size(); ++index) + { + info = m_contexts[index]; + if (info->m_context == ctx) + return info; + } + info = new QOpenGLContextInfo(ctx); + m_contexts.append(info); + connect(ctx, SIGNAL(destroyed()), this, SLOT(aboutToDestroyContext())); } - info = new QGLContextInfo(ctx); - m_contexts.append(info); return info; } -void QGLContextManager::aboutToDestroyContext(const QGLContext *ctx) +void QOpenGLContextManager::aboutToDestroyContext() { + QOpenGLContext *ctx = qobject_cast<QOpenGLContext *>(sender()); + Q_ASSERT_X(ctx, Q_FUNC_INFO, "aboutToDestroy signal not from context"); QMutexLocker locker(&managerLock); int index = 0; while (index < m_contexts.size()) { - QGLContextInfo *info = m_contexts[index]; + QOpenGLContextInfo *info = m_contexts[index]; if (info->m_context == ctx) { - QOpenGLContext *transfer = ctx->contextHandle()->shareContext(); + QOpenGLContext *transfer = ctx->shareContext(); if (transfer) { // Transfer ownership to another context in the same sharing - // group. This may result in multiple QGLContextInfo objects + // group. This may result in multiple QOpenGLContextInfo objects // for the same context, which is ok. - info->m_context = QGLContext::fromOpenGLContext(transfer); + info->m_context = transfer; } else { // All contexts in the sharing group have been deleted, // so detach all of the shared resources. @@ -165,17 +145,17 @@ void QGLContextManager::aboutToDestroyContext(const QGLContext *ctx) } } -const QGLContext *QGLSharedResource::context() const +QOpenGLContext *QGLSharedResource::context() const { // Hope that the context will not be destroyed in another thread // while we are doing this so we don't have to acquire the lock. return m_contextInfo ? m_contextInfo->m_context : 0; } -void QGLSharedResource::attach(const QGLContext *context, GLuint id) +void QGLSharedResource::attach(QOpenGLContext *context, GLuint id) { Q_ASSERT(!m_contextInfo); - QGLContextManager *manager = qt_gl_context_manager(); + QOpenGLContextManager *manager = qt_gl_context_manager(); QMutexLocker locker(&(manager->managerLock)); m_contextInfo = manager->contextInfo(context); m_id = id; @@ -189,8 +169,8 @@ void QGLSharedResource::attach(const QGLContext *context, GLuint id) void QGLSharedResource::destroy() { // Detach this resource from the context information block. - QGLContextManager *manager = qt_gl_context_manager(); - const QGLContext *owner = 0; + QOpenGLContextManager *manager = qt_gl_context_manager(); + QOpenGLContext *owner = 0; GLuint id = 0; manager->managerLock.lock(); if (m_contextInfo) { @@ -211,20 +191,22 @@ void QGLSharedResource::destroy() // Switch back to the owning context temporarily and delete the id. if (owner && id) { - QGLContext *currentContext = const_cast<QGLContext *>(QGLContext::currentContext()); - QGLContext *oldContext; - QGLContext *doneContext; - if (currentContext != owner && !QGLContext::areSharing(owner, currentContext)) { + QOpenGLContext *currentContext = QOpenGLContext::currentContext(); + QSurface *surf = currentContext->surface(); + QOpenGLContext *oldContext; + QOpenGLContext *doneContext; + if (currentContext != owner && !QOpenGLContext::areSharing + (const_cast<QOpenGLContext *>(owner), currentContext)) { oldContext = currentContext; - doneContext = const_cast<QGLContext *>(owner); - doneContext->makeCurrent(); + doneContext = owner; + doneContext->makeCurrent(surf); } else { oldContext = 0; doneContext = 0; } m_destroyFunc(id); if (oldContext) - oldContext->makeCurrent(); + oldContext->makeCurrent(surf); else if (!currentContext && doneContext) doneContext->doneCurrent(); } diff --git a/src/threed/textures/qglsharedresource_p.h b/src/threed/textures/qglsharedresource_p.h index d8c7d1216..1a34d7421 100644 --- a/src/threed/textures/qglsharedresource_p.h +++ b/src/threed/textures/qglsharedresource_p.h @@ -53,14 +53,15 @@ // We mean it. // -#include <QtOpenGL/qgl.h> +#include <QOpenGLBuffer> QT_BEGIN_HEADER QT_BEGIN_NAMESPACE -class QGLContextManager; -class QGLContextInfo; +class QOpenGLContextManager; +class QOpenGLContextInfo; +class QOpenGLContext; class QGLSharedResource { @@ -71,22 +72,22 @@ public: , m_next(0), m_prev(0) {} ~QGLSharedResource() { destroy(); } - const QGLContext *context() const; + QOpenGLContext *context() const; GLuint id() const { return m_id; } void clearId() { m_id = 0; } - void attach(const QGLContext *context, GLuint id); + void attach(QOpenGLContext *context, GLuint id); void destroy(); private: DestroyResourceFunc m_destroyFunc; - QGLContextInfo *m_contextInfo; + QOpenGLContextInfo *m_contextInfo; GLuint m_id; QGLSharedResource *m_next; QGLSharedResource *m_prev; - friend class QGLContextManager; - friend class QGLContextInfo; + friend class QOpenGLContextManager; + friend class QOpenGLContextInfo; }; QT_END_NAMESPACE diff --git a/src/threed/textures/qgltexture2d.cpp b/src/threed/textures/qgltexture2d.cpp index 39f15461e..d06c0bc36 100644 --- a/src/threed/textures/qgltexture2d.cpp +++ b/src/threed/textures/qgltexture2d.cpp @@ -45,8 +45,12 @@ #include "qglpainter_p.h" #include "qglext_p.h" -#include <QtCore/qfile.h> -#include <QtCore/qfileinfo.h> +#include <QFile> +#include <QFileInfo> + +#ifdef QT_OPENGL_LIB +#include <QGLWidget> +#endif QT_BEGIN_NAMESPACE @@ -90,7 +94,7 @@ QGLTexture2DPrivate::QGLTexture2DPrivate() { horizontalWrap = QGL::Repeat; verticalWrap = QGL::Repeat; - bindOptions = QGLContext::DefaultBindOption; + bindOptions = QGLTexture2D::DefaultBindOption; #if !defined(QT_OPENGL_ES) mipmapSupported = false; mipmapSupportedKnown = false; @@ -103,11 +107,14 @@ QGLTexture2DPrivate::QGLTexture2DPrivate() QGLTexture2DPrivate::~QGLTexture2DPrivate() { // Destroy the texture id's in the GL server in their original contexts. + // TODO: XXXXXXX + // This probably does not work at all in multi-threaded OpenGL environments + // like the QML SceneGraph QGLTexture2DTextureInfo *current = infos; QGLTexture2DTextureInfo *next; - const QGLContext *currentContext = - const_cast<QGLContext *>(QGLContext::currentContext()); - const QGLContext *firstContext = currentContext; + QOpenGLContext *currentContext = QOpenGLContext::currentContext(); + QOpenGLContext *firstContext = currentContext; + QSurface *surface = currentContext->surface(); while (current != 0) { next = current->next; if (current->isLiteral) @@ -117,9 +124,9 @@ QGLTexture2DPrivate::~QGLTexture2DPrivate() } if (firstContext != currentContext) { if (firstContext) - const_cast<QGLContext *>(firstContext)->makeCurrent(); + const_cast<QOpenGLContext *>(firstContext)->makeCurrent(surface); else if (currentContext) - const_cast<QGLContext *>(currentContext)->doneCurrent(); + const_cast<QOpenGLContext *>(currentContext)->doneCurrent(); } } @@ -182,12 +189,17 @@ QSize QGLTexture2D::size() const } /*! - Sets the size of this texture to \a value. If the underlying - OpenGL implementation requires texture sizes to be a power of - two, then requestedSize() will be set to \a value, and the - actual size will be set to the next power of two equal - to or greater than \a value. Otherwise both size() and - requestedSize() will be set to \a value. + Sets the size of this texture to \a value. Also sets the + requestedSize to \a value. + + Note that the underlying OpenGL implementation may require texture sizes + to be a power of two. If that is the case, then \b{when the texture is bound} + this will be detected, and while requestedSize() will remain at \a value, + the size() will be set to the next power of two equal to or greater than + \a value. + + For this reason to get a definitive value of the actual size of the underlying + texture, query the size after bind() has been done. \sa size(), requestedSize() */ @@ -196,11 +208,7 @@ void QGLTexture2D::setSize(const QSize& value) Q_D(QGLTexture2D); if (d->requestedSize == value) return; - if (!(QGLFormat::openGLVersionFlags() & QGLFormat::OpenGL_Version_2_0) - && !(QGLFormat::openGLVersionFlags() & QGLFormat::OpenGL_ES_Version_2_0)) - d->size = QGL::nextPowerOfTwo(value); - else - d->size = value; + d->size = value; d->requestedSize = value; ++(d->imageGeneration); } @@ -345,9 +353,9 @@ bool QGLTexture2D::setCompressedFile(const QString &path) // The 3DS loader expects the flip state to be set before bind(). if (isFlipped) - d->bindOptions &= ~QGLContext::InvertedYBindOption; + d->bindOptions &= ~QGLTexture2D::InvertedYBindOption; else - d->bindOptions |= QGLContext::InvertedYBindOption; + d->bindOptions |= QGLTexture2D::InvertedYBindOption; d->compressedData = data; ++(d->imageGeneration); @@ -434,30 +442,39 @@ void QGLTexture2D::setUrl(const QUrl &url) If the texture has been created in multiple contexts, only the texture identifier for the current context will be updated. + This function is only available if Qt has been compiled with the + OpenGL library. If that library is not present, then this function + does nothing. + \sa setImage(), bind() */ void QGLTexture2D::copyImage(const QImage& image, const QPoint& offset) { +#ifdef QT_OPENGL_LIB QImage img = QGLWidget::convertToGLFormat(image); glTexSubImage2D(GL_TEXTURE_2D, 0, offset.x(), offset.y(), img.width(), img.height(), GL_RGBA, GL_UNSIGNED_BYTE, img.bits()); #if defined(QT_OPENGL_ES_2) Q_D(QGLTexture2D); - if (d->bindOptions & QGLContext::MipmapBindOption) + if (d->bindOptions & QGLTexture2D::MipmapBindOption) glGenerateMipmap(GL_TEXTURE_2D); #endif +#else + Q_UNUSED(image); + Q_UNUSED(offset); +#endif } /*! Returns the options to use when binding the image() to an OpenGL context for the first time. The default options are - QGLContext::LinearFilteringBindOption | - QGLContext::InvertedYBindOption | QGLContext::MipmapBindOption. + QGLTexture2D::LinearFilteringBindOption | + QGLTexture2D::InvertedYBindOption | QGLTexture2D::MipmapBindOption. \sa setBindOptions() */ -QGLContext::BindOptions QGLTexture2D::bindOptions() const +QGLTexture2D::BindOptions QGLTexture2D::bindOptions() const { Q_D(const QGLTexture2D); return d->bindOptions; @@ -471,7 +488,7 @@ QGLContext::BindOptions QGLTexture2D::bindOptions() const \sa bindOptions(), bind() */ -void QGLTexture2D::setBindOptions(QGLContext::BindOptions options) +void QGLTexture2D::setBindOptions(QGLTexture2D::BindOptions options) { Q_D(QGLTexture2D); if (d->bindOptions != options) { @@ -495,11 +512,6 @@ QGL::TextureWrap QGLTexture2D::horizontalWrap() const /*! Sets the wrapping mode for horizontal texture co-ordinates to \a value. - If \a value is not supported by the OpenGL implementation, it will be - replaced with a value that is supported. If the application desires a - very specific \a value, it can call horizontalWrap() to check that - the specific value was actually set. - The \a value will not be applied to the texture in the GL server until the next call to bind(). @@ -508,7 +520,6 @@ QGL::TextureWrap QGLTexture2D::horizontalWrap() const void QGLTexture2D::setHorizontalWrap(QGL::TextureWrap value) { Q_D(QGLTexture2D); - value = qt_gl_modify_texture_wrap(value); if (d->horizontalWrap != value) { d->horizontalWrap = value; ++(d->parameterGeneration); @@ -543,7 +554,6 @@ QGL::TextureWrap QGLTexture2D::verticalWrap() const void QGLTexture2D::setVerticalWrap(QGL::TextureWrap value) { Q_D(QGLTexture2D); - value = qt_gl_modify_texture_wrap(value); if (d->verticalWrap != value) { d->verticalWrap = value; ++(d->parameterGeneration); @@ -574,7 +584,7 @@ bool QGLTexture2DPrivate::bind(GLenum target) { // Get the current context. If we don't have one, then we // cannot bind the texture. - const QGLContext *ctx = QGLContext::currentContext(); + QOpenGLContext *ctx = QOpenGLContext::currentContext(); if (!ctx) return false; @@ -590,7 +600,7 @@ bool QGLTexture2DPrivate::bind(GLenum target) } } - if ((bindOptions & QGLContext::MipmapBindOption) || + if ((bindOptions & QGLTexture2D::MipmapBindOption) || horizontalWrap != QGL::ClampToEdge || verticalWrap != QGL::ClampToEdge) { // This accounts for the broken Intel HD 3000 graphics support at least @@ -604,7 +614,8 @@ bool QGLTexture2DPrivate::bind(GLenum target) // Find the information block for the context, or create one. QGLTexture2DTextureInfo *info = infos; QGLTexture2DTextureInfo *prev = 0; - while (info != 0 && !QGLContext::areSharing(info->tex.context(), ctx)) { + QOpenGLContext *ictx = const_cast<QOpenGLContext*>(info->tex.context()); + while (info != 0 && !QOpenGLContext::areSharing(ictx, ctx)) { if (info->isLiteral) return false; // Cannot create extra texture id's for literals. prev = info; @@ -651,7 +662,7 @@ void QGLTexture2DPrivate::bindImages(QGLTexture2DTextureInfo *info) { QSize scaledSize(size); #if defined(QT_OPENGL_ES_2) - if ((bindOptions & QGLContext::MipmapBindOption) || + if ((bindOptions & QGLTexture2D::MipmapBindOption) || horizontalWrap != QGL::ClampToEdge || verticalWrap != QGL::ClampToEdge) { // ES 2.0 does not support NPOT textures when mipmaps are in use, @@ -688,11 +699,12 @@ void QGLTexture2D::release() const GLuint QGLTexture2D::textureId() const { Q_D(const QGLTexture2D); - const QGLContext *ctx = QGLContext::currentContext(); + QOpenGLContext *ctx = QOpenGLContext::currentContext(); if (!ctx) return 0; QGLTexture2DTextureInfo *info = d->infos; - while (info != 0 && !QGLContext::areSharing(info->tex.context(), ctx)) + QOpenGLContext *ictx = const_cast<QOpenGLContext*>(info->tex.context()); + while (info != 0 && !QOpenGLContext::areSharing(ictx, ctx)) info = info->next; return info ? info->tex.textureId() : 0; } @@ -713,7 +725,7 @@ GLuint QGLTexture2D::textureId() const */ QGLTexture2D *QGLTexture2D::fromTextureId(GLuint id, const QSize& size) { - const QGLContext *ctx = QGLContext::currentContext(); + QOpenGLContext *ctx = QOpenGLContext::currentContext(); if (!id || !ctx) return 0; diff --git a/src/threed/textures/qgltexture2d.h b/src/threed/textures/qgltexture2d.h index 187cebf33..5bb28f2e6 100644 --- a/src/threed/textures/qgltexture2d.h +++ b/src/threed/textures/qgltexture2d.h @@ -43,8 +43,11 @@ #define QGLTEXTURE2D_H #include "qglnamespace.h" -#include <QtOpenGL/qgl.h> -#include <QtCore/qscopedpointer.h> + +#include <QOpenGLBuffer> +#include <QScopedPointer> +#include <QPoint> +#include <QObject> QT_BEGIN_HEADER @@ -58,6 +61,18 @@ class Q_QT3D_EXPORT QGLTexture2D : public QObject { Q_OBJECT public: + enum BindOption + { + NoBindOption = 0x0000, + InvertedYBindOption = 0x0001, + MipmapBindOption = 0x0002, + PremultipliedAlphaBindOption = 0x0004, + LinearFilteringBindOption = 0x0008, + DefaultBindOption = LinearFilteringBindOption + | InvertedYBindOption | MipmapBindOption + }; + Q_DECLARE_FLAGS(BindOptions, BindOption) + QGLTexture2D(QObject *parent = 0); ~QGLTexture2D(); @@ -80,8 +95,8 @@ public: void copyImage(const QImage& image, const QPoint& offset = QPoint(0, 0)); - QGLContext::BindOptions bindOptions() const; - void setBindOptions(QGLContext::BindOptions options); + BindOptions bindOptions() const; + void setBindOptions(BindOptions options); QGL::TextureWrap horizontalWrap() const; void setHorizontalWrap(QGL::TextureWrap value); @@ -103,6 +118,8 @@ private: Q_DECLARE_PRIVATE(QGLTexture2D) }; +Q_DECLARE_OPERATORS_FOR_FLAGS(QGLTexture2D::BindOptions) + QT_END_NAMESPACE QT_END_HEADER diff --git a/src/threed/textures/qgltexture2d_p.h b/src/threed/textures/qgltexture2d_p.h index 56104854d..38f18f0ed 100644 --- a/src/threed/textures/qgltexture2d_p.h +++ b/src/threed/textures/qgltexture2d_p.h @@ -57,7 +57,8 @@ #include "qgltextureutils_p.h" #include "qurl.h" -#include <QtCore/qatomic.h> +#include <QAtomicInt> +#include <QImage> QT_BEGIN_NAMESPACE @@ -65,7 +66,7 @@ class QGLTexture2DTextureInfo { public: QGLTexture2DTextureInfo - (const QGLContext *context, GLuint textureId, uint imageGeneration, + (QOpenGLContext *context, GLuint textureId, uint imageGeneration, uint parameterGeneration, bool isLiteral = false) { if (textureId) @@ -96,7 +97,7 @@ public: QImage image; QUrl url; QByteArray compressedData; - QGLContext::BindOptions bindOptions; + QGLTexture2D::BindOptions bindOptions; QGL::TextureWrap horizontalWrap; QGL::TextureWrap verticalWrap; #if !defined(QT_OPENGL_ES) diff --git a/src/threed/textures/qgltexturecube.cpp b/src/threed/textures/qgltexturecube.cpp index 5d1046154..0696a0b33 100644 --- a/src/threed/textures/qgltexturecube.cpp +++ b/src/threed/textures/qgltexturecube.cpp @@ -44,6 +44,13 @@ #include "qgltextureutils_p.h" #include "qglpainter_p.h" +#include <QOpenGLBuffer> +#include <QOpenGLContext> + +#ifdef QT_OPENGL_LIB +#include <QGLWidget> +#endif + QT_BEGIN_NAMESPACE /*! @@ -117,7 +124,7 @@ void QGLTextureCubePrivate::bindImages(QGLTexture2DTextureInfo *info) { QSize scaledSize(size); #if defined(QT_OPENGL_ES_2) - if ((bindOptions & QGLContext::MipmapBindOption) || + if ((bindOptions & QGLTexture2D::MipmapBindOption) || horizontalWrap != QGL::ClampToEdge || verticalWrap != QGL::ClampToEdge) { // ES 2.0 does not support NPOT textures when mipmaps are in use, @@ -223,11 +230,7 @@ void QGLTextureCube::setSize(const QSize& value) Q_D(QGLTextureCube); if (d->requestedSize == value) return; - if (!(QGLFormat::openGLVersionFlags() & QGLFormat::OpenGL_Version_2_0) && - !(QGLFormat::openGLVersionFlags() & QGLFormat::OpenGL_ES_Version_2_0)) - d->size = QGL::nextPowerOfTwo(value); - else - d->size = value; + d->size = value; d->requestedSize = value; ++(d->imageGeneration); } @@ -344,11 +347,16 @@ void QGLTextureCube::clearImage(QGLTextureCube::Face face) If the texture has been created in multiple contexts, only the texture identifier for the current context will be updated. + This function is only available if Qt has been compiled with the + OpenGL library. If that library is not present, then this function + does nothing. + \sa setImage(), bind() */ void QGLTextureCube::copyImage (QGLTextureCube::Face face, const QImage& image, const QPoint& offset) { +#ifdef QT_OPENGL_LIB if (uint(face) >= 6) return; // Invalid face number. QImage img = QGLWidget::convertToGLFormat(image); @@ -358,20 +366,25 @@ void QGLTextureCube::copyImage GL_UNSIGNED_BYTE, img.bits()); #if defined(QT_OPENGL_ES_2) Q_D(QGLTextureCube); - if (d->bindOptions & QGLContext::MipmapBindOption) + if (d->bindOptions & QGLTexture2D::MipmapBindOption) glGenerateMipmap(GL_TEXTURE_CUBE_MAP); #endif +#else + Q_UNUSED(face); + Q_UNUSED(image); + Q_UNUSED(offset); +#endif } /*! Returns the options to use when binding the image() to an OpenGL context for the first time. The default options are - QGLContext::LinearFilteringBindOption | - QGLContext::InvertedYBindOption | QGLContext::MipmapBindOption. + QGLTexture2D::LinearFilteringBindOption | + QGLTexture2D::InvertedYBindOption | QGLTexture2D::MipmapBindOption. \sa setBindOptions() */ -QGLContext::BindOptions QGLTextureCube::bindOptions() const +QGLTexture2D::BindOptions QGLTextureCube::bindOptions() const { Q_D(const QGLTextureCube); return d->bindOptions; @@ -385,7 +398,7 @@ QGLContext::BindOptions QGLTextureCube::bindOptions() const \sa bindOptions(), bind() */ -void QGLTextureCube::setBindOptions(QGLContext::BindOptions options) +void QGLTextureCube::setBindOptions(QGLTexture2D::BindOptions options) { Q_D(QGLTextureCube); if (d->bindOptions != options) { @@ -422,7 +435,6 @@ QGL::TextureWrap QGLTextureCube::horizontalWrap() const void QGLTextureCube::setHorizontalWrap(QGL::TextureWrap value) { Q_D(QGLTextureCube); - value = qt_gl_modify_texture_wrap(value); if (d->horizontalWrap != value) { d->horizontalWrap = value; ++(d->parameterGeneration); @@ -457,7 +469,7 @@ QGL::TextureWrap QGLTextureCube::verticalWrap() const void QGLTextureCube::setVerticalWrap(QGL::TextureWrap value) { Q_D(QGLTextureCube); - value = qt_gl_modify_texture_wrap(value); + if (d->verticalWrap != value) { d->verticalWrap = value; ++(d->parameterGeneration); @@ -507,7 +519,7 @@ void QGLTextureCube::release() GLuint QGLTextureCube::textureId() const { Q_D(const QGLTextureCube); - const QGLContext *ctx = QGLContext::currentContext(); + const QOpenGLContext *ctx = QOpenGLContext::currentContext(); if (!ctx) return 0; QGLTexture2DTextureInfo *info = d->infos; @@ -532,7 +544,7 @@ GLuint QGLTextureCube::textureId() const */ QGLTextureCube *QGLTextureCube::fromTextureId(GLuint id, const QSize& size) { - const QGLContext *ctx = QGLContext::currentContext(); + QOpenGLContext *ctx = QOpenGLContext::currentContext(); if (!id || !ctx) return 0; diff --git a/src/threed/textures/qgltexturecube.h b/src/threed/textures/qgltexturecube.h index 50855b805..c2209881e 100644 --- a/src/threed/textures/qgltexturecube.h +++ b/src/threed/textures/qgltexturecube.h @@ -43,7 +43,9 @@ #define QGLTEXTURECUBEMAP_H #include "qglnamespace.h" -#include <QtOpenGL/qgl.h> +#include "qgltexture2d.h" + +#include <QOpenGLBuffer> QT_BEGIN_HEADER @@ -82,8 +84,8 @@ public: void copyImage(QGLTextureCube::Face face, const QImage& image, const QPoint& offset = QPoint(0, 0)); - QGLContext::BindOptions bindOptions() const; - void setBindOptions(QGLContext::BindOptions options); + QGLTexture2D::BindOptions bindOptions() const; + void setBindOptions(QGLTexture2D::BindOptions options); QGL::TextureWrap horizontalWrap() const; void setHorizontalWrap(QGL::TextureWrap value); diff --git a/src/threed/textures/qgltextureutils.cpp b/src/threed/textures/qgltextureutils.cpp index e3ebae228..84abaec5f 100644 --- a/src/threed/textures/qgltextureutils.cpp +++ b/src/threed/textures/qgltextureutils.cpp @@ -41,55 +41,20 @@ #include "qgltextureutils_p.h" #include "qglext_p.h" -#include <QtCore/qfile.h> -#include <private/qopenglcontext_p.h> + +#include <QFile> +#include <QImage> QT_BEGIN_NAMESPACE -QGL::TextureWrap qt_gl_modify_texture_wrap(QGL::TextureWrap value) +inline static bool isPowerOfTwo(int x) { - switch (value) { -#if defined(QT_OPENGL_ES) - case QGL::Clamp: - value = QGL::ClampToEdge; - break; -#endif -#if !defined(QT_OPENGL_ES) - case QGL::ClampToBorder: - if ((QGLFormat::openGLVersionFlags() & QGLFormat::OpenGL_Version_1_3) - == 0) - value = QGL::Clamp; - break; -#else - case QGL::ClampToBorder: - value = QGL::ClampToEdge; - break; -#endif -#if !defined(QT_OPENGL_ES) - case QGL::ClampToEdge: - if ((QGLFormat::openGLVersionFlags() & QGLFormat::OpenGL_Version_1_2) - == 0) - value = QGL::Clamp; - break; -#endif -#if !defined(QT_OPENGL_ES) - case QGL::MirroredRepeat: - if ((QGLFormat::openGLVersionFlags() & QGLFormat::OpenGL_Version_1_4) - == 0) - value = QGL::Repeat; - break; -#elif !defined(QT_OPENGL_ES_2) - case QGL::MirroredRepeat: - value = QGL::Repeat; - break; -#endif - default: break; - } - return value; + // Assumption: x >= 1 + return x == (x & -x); } -QGLTextureExtensions::QGLTextureExtensions(const QGLContext *ctx) - : QOpenGLSharedResource(ctx->contextHandle()->shareGroup()) +QGLTextureExtensions::QGLTextureExtensions(QOpenGLContext *ctx) + : QOpenGLSharedResource(ctx->shareGroup()) , npotTextures(false) , generateMipmap(false) , bgraTextureFormat(false) @@ -119,7 +84,7 @@ QGLTextureExtensions::QGLTextureExtensions(const QGLContext *ctx) #if !defined(QT_OPENGL_ES) if (extensions.match("GL_ARB_texture_compression")) { compressedTexImage2D = (q_glCompressedTexImage2DARB) - ctx->getProcAddress(QLatin1String("glCompressedTexImage2DARB")); + ctx->getProcAddress("glCompressedTexImage2DARB"); } #else compressedTexImage2D = glCompressedTexImage2D; @@ -127,23 +92,25 @@ QGLTextureExtensions::QGLTextureExtensions(const QGLContext *ctx) } -static QGLTextureExtensions *qt_gl_texture_extensions; +struct QGLTEHelper +{ + QGLTextureExtensions *d; +}; + +Q_GLOBAL_STATIC(QGLTEHelper, qt_qgltehelper) QGLTextureExtensions::~QGLTextureExtensions() { - qt_gl_texture_extensions = 0; } - - QGLTextureExtensions *QGLTextureExtensions::extensions() { - const QGLContext *ctx = QGLContext::currentContext(); + QOpenGLContext *ctx = QOpenGLContext::currentContext(); if (!ctx) return 0; - if (!qt_gl_texture_extensions) - qt_gl_texture_extensions = new QGLTextureExtensions(ctx); - return qt_gl_texture_extensions; + if (!qt_qgltehelper()->d) + qt_qgltehelper()->d = new QGLTextureExtensions(ctx); + return qt_qgltehelper()->d; } static void qt_gl_destroyTextureId(GLuint id) @@ -153,7 +120,7 @@ static void qt_gl_destroyTextureId(GLuint id) QGLBoundTexture::QGLBoundTexture() : m_resource(qt_gl_destroyTextureId) - , m_options(QGLContext::DefaultBindOption) + , m_options(QGLTexture2D::DefaultBindOption) , m_hasAlpha(false) { } @@ -164,7 +131,7 @@ QGLBoundTexture::~QGLBoundTexture() // #define QGL_BIND_TEXTURE_DEBUG -void QGLBoundTexture::startUpload(const QGLContext *ctx, GLenum target, const QSize &imageSize) +void QGLBoundTexture::startUpload(QOpenGLContext *ctx, GLenum target, const QSize &imageSize) { Q_UNUSED(imageSize); @@ -195,16 +162,14 @@ void QGLBoundTexture::startUpload(const QGLContext *ctx, GLenum target, const QS glBindTexture(target, id); m_resource.attach(ctx, id); - GLuint filtering = m_options & QGLContext::LinearFilteringBindOption ? GL_LINEAR : GL_NEAREST; + GLuint filtering = m_options & QGLTexture2D::LinearFilteringBindOption ? GL_LINEAR : GL_NEAREST; #ifdef QGL_BIND_TEXTURE_DEBUG printf(" - setting options (%d ms)\n", time.elapsed()); #endif q_glTexParameteri(target, GL_TEXTURE_MAG_FILTER, filtering); - if (QGLContext::currentContext()->format().directRendering() - && extensions->generateMipmap - && (m_options & QGLContext::MipmapBindOption)) + if (extensions->generateMipmap && (m_options & QGLTexture2D::MipmapBindOption)) { #if !defined(QT_OPENGL_ES_2) glHint(GL_GENERATE_MIPMAP_HINT_SGIS, GL_NICEST); @@ -213,11 +178,11 @@ void QGLBoundTexture::startUpload(const QGLContext *ctx, GLenum target, const QS glHint(GL_GENERATE_MIPMAP_HINT, GL_NICEST); #endif q_glTexParameteri(target, GL_TEXTURE_MIN_FILTER, - m_options & QGLContext::LinearFilteringBindOption + m_options & QGLTexture2D::LinearFilteringBindOption ? GL_LINEAR_MIPMAP_LINEAR : GL_NEAREST_MIPMAP_NEAREST); } else { q_glTexParameteri(target, GL_TEXTURE_MIN_FILTER, filtering); - m_options &= ~QGLContext::MipmapBindOption; + m_options &= ~QGLTexture2D::MipmapBindOption; } } @@ -270,18 +235,19 @@ void QGLBoundTexture::uploadFace m_size = size; QImage::Format target_format = img.format(); - bool premul = m_options & QGLContext::PremultipliedAlphaBindOption; + bool premul = m_options & QGLTexture2D::PremultipliedAlphaBindOption; GLenum externalFormat; - GLuint pixel_type; + GLuint pixel_type = GL_UNSIGNED_BYTE; if (extensions->bgraTextureFormat) { externalFormat = GL_BGRA; - if (QGLFormat::openGLVersionFlags() & QGLFormat::OpenGL_Version_1_2) - pixel_type = GL_UNSIGNED_INT_8_8_8_8_REV; - else - pixel_type = GL_UNSIGNED_BYTE; + // under OpenGL 1.2 with this extension apparently the pixel format might be + // some GL_UNSIGNED_INT_8_8_8_8_REV - that is 5 years plus out of date, so + // don't do that. +#ifdef QGL_BIND_TEXTURE_DEBUG + qWarning("Checking for old image formats now not supported"); +#endif } else { externalFormat = GL_RGBA; - pixel_type = GL_UNSIGNED_BYTE; } switch (target_format) { @@ -324,7 +290,7 @@ void QGLBoundTexture::uploadFace } } - if (m_options & QGLContext::InvertedYBindOption) { + if (m_options & QGLTexture2D::InvertedYBindOption) { #ifdef QGL_BIND_TEXTURE_DEBUG printf(" - flipping bits over y (%d ms)\n", time.elapsed()); #endif @@ -388,7 +354,7 @@ void QGLBoundTexture::finishUpload(GLenum target) #if defined(QT_OPENGL_ES_2) // OpenGL/ES 2.0 needs to generate mipmaps after all cubemap faces // have been uploaded. - if (m_options & QGLContext::MipmapBindOption) { + if (m_options & QOpenGLContext::MipmapBindOption) { #ifdef QGL_BIND_TEXTURE_DEBUG printf(" - generating mipmaps (%d ms)\n", time.elapsed()); #endif @@ -546,7 +512,7 @@ bool QGLBoundTexture::bindCompressedTexture if (!extensions) return false; if (!extensions->compressedTexImage2D) { - qWarning("QGLContext::bindTexture(): The GL implementation does " + qWarning("QOpenGLContext::bindTexture(): The GL implementation does " "not support texture compression extensions."); return false; } @@ -632,7 +598,7 @@ bool QGLBoundTexture::bindCompressedTextureDDS(const char *buf, int len) glBindTexture(GL_TEXTURE_2D, id); q_glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); q_glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); - m_resource.attach(QGLContext::currentContext(), id); + m_resource.attach(QOpenGLContext::currentContext(), id); int size; int offset = 0; @@ -659,7 +625,7 @@ bool QGLBoundTexture::bindCompressedTextureDDS(const char *buf, int len) } // DDS images are not inverted. - m_options &= ~QGLContext::InvertedYBindOption; + m_options &= ~QGLTexture2D::InvertedYBindOption; m_size = QSize(ddsHeader->dwWidth, ddsHeader->dwHeight); m_hasAlpha = false; @@ -736,16 +702,16 @@ bool QGLBoundTexture::bindCompressedTexturePVR(const char *buf, int len) id = 0; glGenTextures(1, &id); glBindTexture(GL_TEXTURE_2D, id); - m_resource.attach(QGLContext::currentContext(), id); + m_resource.attach(QOpenGLContext::currentContext(), id); if (pvrHeader->mipMapCount) { - if ((m_options & QGLContext::LinearFilteringBindOption) != 0) { + if ((m_options & QGLTexture2D::LinearFilteringBindOption) != 0) { glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR); } else { glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST_MIPMAP_NEAREST); } - } else if ((m_options & QGLContext::LinearFilteringBindOption) != 0) { + } else if ((m_options & QGLTexture2D::LinearFilteringBindOption) != 0) { glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); } else { @@ -781,9 +747,9 @@ bool QGLBoundTexture::bindCompressedTexturePVR(const char *buf, int len) // Set the invert flag for the texture. The "vertical flip" // flag in PVR is the opposite sense to our sense of inversion. if ((pvrHeader->flags & PVR_VERTICAL_FLIP) != 0) - m_options &= ~QGLContext::InvertedYBindOption; + m_options &= ~QGLTexture2D::InvertedYBindOption; else - m_options |= QGLContext::InvertedYBindOption; + m_options |= QGLTexture2D::InvertedYBindOption; m_size = QSize(pvrHeader->width, pvrHeader->height); m_hasAlpha = (pvrHeader->alphaMask != 0); diff --git a/src/threed/textures/qgltextureutils_p.h b/src/threed/textures/qgltextureutils_p.h index dfcfa7662..65a430e55 100644 --- a/src/threed/textures/qgltextureutils_p.h +++ b/src/threed/textures/qgltextureutils_p.h @@ -53,11 +53,14 @@ // We mean it. // -#include <QtOpenGL/qgl.h> -#include <QtCore/qdatetime.h> +#include <QOpenGLBuffer> +#include <QDateTime> +#include <QSize> + #include "qglnamespace.h" #include "qopenglfunctions.h" #include "qglsharedresource_p.h" +#include "qgltexture2d.h" #include <private/qopenglcontext_p.h> @@ -95,16 +98,13 @@ QT_BEGIN_NAMESPACE glTexParameterf((target), (name), GLfloat(int(value))) #endif -// Modify a wrapping mode to account for platform differences. -QGL::TextureWrap qt_gl_modify_texture_wrap(QGL::TextureWrap value); - typedef void (QOPENGLF_APIENTRYP q_glCompressedTexImage2DARB) (GLenum, GLint, GLenum, GLsizei, GLsizei, GLint, GLsizei, const GLvoid *); class QGLTextureExtensions : public QOpenGLSharedResource { public: - QGLTextureExtensions(const QGLContext *ctx); + QGLTextureExtensions(QOpenGLContext *ctx); ~QGLTextureExtensions(); int npotTextures : 1; @@ -128,20 +128,20 @@ public: QGLBoundTexture(); ~QGLBoundTexture(); - const QGLContext *context() const { return m_resource.context(); } + const QOpenGLContext *context() const { return m_resource.context(); } GLuint textureId() const { return m_resource.id(); } - void setTextureId(const QGLContext *ctx, GLuint id) + void setTextureId(QOpenGLContext *ctx, GLuint id) { m_resource.attach(ctx, id); } void clearId() { m_resource.clearId(); } - QGLContext::BindOptions options() const { return m_options; } - void setOptions(QGLContext::BindOptions options) { m_options = options; } + QGLTexture2D::BindOptions options() const { return m_options; } + void setOptions(QGLTexture2D::BindOptions options) { m_options = options; } QSize size() const { return m_size; } bool hasAlpha() const { return m_hasAlpha; } - void startUpload(const QGLContext *ctx, GLenum target, const QSize &imageSize); + void startUpload(QOpenGLContext *ctx, GLenum target, const QSize &imageSize); void uploadFace(GLenum target, const QImage &image, const QSize &scaleSize, GLenum format = GL_RGBA); void createFace(GLenum target, const QSize &size, GLenum format = GL_RGBA); @@ -159,7 +159,7 @@ public: private: QGLSharedResource m_resource; - QGLContext::BindOptions m_options; + QGLTexture2D::BindOptions m_options; QSize m_size; bool m_hasAlpha; QTime time; diff --git a/src/threed/textures/textures.pri b/src/threed/textures/textures.pri index ce60c58ee..d4c295794 100644 --- a/src/threed/textures/textures.pri +++ b/src/threed/textures/textures.pri @@ -12,4 +12,5 @@ SOURCES += \ qgltextureutils.cpp PRIVATE_HEADERS += \ qglsharedresource_p.h \ - qgltexture2d_p.h + qgltexture2d_p.h \ + qgltextureutils_p.h diff --git a/src/threed/threed.pro b/src/threed/threed.pro index cbc88ef67..55ce81132 100644 --- a/src/threed/threed.pro +++ b/src/threed/threed.pro @@ -2,7 +2,7 @@ load(qt_module) TARGET = Qt3D MODULE = qt3d -QT = core-private gui-private opengl network widgets +QT = core-private gui-private network CONFIG += module MODULE_PRI = ../../modules/qt_qt3d.pri @@ -24,3 +24,9 @@ HEADERS += $$PRIVATE_HEADERS DEFINES += QT_BUILD_QT3D_LIB !contains(QT_CONFIG, egl):DEFINES += QT_NO_EGL + +# This is the *desktop* opengl library, which is not supported on some +# smaller footprint systems. If this is turned off, then (for example) +# pixel-buffer objects are not supported. +!isEmpty(QT.opengl.name): QT += opengl +!isEmpty(QT.widgets.name): QT += widgets diff --git a/src/threed/viewing/qglview.cpp b/src/threed/viewing/qglview.cpp index 8d971081f..0011848c2 100644 --- a/src/threed/viewing/qglview.cpp +++ b/src/threed/viewing/qglview.cpp @@ -40,21 +40,23 @@ ****************************************************************************/ #include "qglview.h" -#include "qglframebufferobject.h" #include "qglsubsurface.h" #include "qglmaskedsurface_p.h" #include "qglwindowsurface.h" #include "qgldrawbuffersurface_p.h" #include "qray3d.h" -#include <QtGui/qevent.h> -#include <QtCore/qmap.h> -#include <QtWidgets/qapplication.h> -#include <QtCore/qtimer.h> -#include <QtCore/qdatetime.h> -#include <QtCore/qdebug.h> -#include <QtGui/QOpenGLContext> -#include <QtGui/QSurfaceFormat> +#include <QOpenGLFramebufferObject> +#include <QEvent> +#include <QMap> +#include <QGuiApplication> +#include <QTimer> +#include <QDateTime> +#include <QDebug> +#include <QResizeEvent> +#include <QExposeEvent> +#include <QOpenGLContext> +#include <QSurfaceFormat> QT_BEGIN_NAMESPACE @@ -270,7 +272,7 @@ public: QRect viewport; QGLView::Options options; QGLView::StereoType stereoType; - QGLFramebufferObject *fbo; + QOpenGLFramebufferObject *fbo; QGLWindowSurface mainSurface; bool visible; QGLAbstractSurface *leftSurface; @@ -357,7 +359,7 @@ inline void QGLViewPrivate::ensureContext() static QString qt_gl_stereo_arg() { - QStringList args = QApplication::arguments(); + QStringList args = QGuiApplication::arguments(); foreach (QString arg, args) { if (arg.startsWith(QLatin1String("-stereo-"))) return arg; @@ -966,7 +968,7 @@ void QGLView::update() if (!d->updateQueued) { d->updateQueued = true; - QApplication::postEvent(this, new QExposeEvent(geometry())); + QGuiApplication::postEvent(this, new QExposeEvent(geometry())); } } @@ -1294,7 +1296,7 @@ void QGLView::keyPressEvent(QKeyEvent *e) class QGLViewPickSurface : public QGLAbstractSurface { public: - QGLViewPickSurface(QGLView *view, QGLFramebufferObject *fbo, + QGLViewPickSurface(QGLView *view, QOpenGLFramebufferObject *fbo, const QSize &areaSize); QPaintDevice *device() const; @@ -1304,12 +1306,12 @@ public: private: QGLView *m_view; - QGLFramebufferObject *m_fbo; + QOpenGLFramebufferObject *m_fbo; QRect m_viewportGL; }; QGLViewPickSurface::QGLViewPickSurface - (QGLView *view, QGLFramebufferObject *fbo, const QSize &areaSize) + (QGLView *view, QOpenGLFramebufferObject *fbo, const QSize &areaSize) : QGLAbstractSurface(504) , m_view(view) , m_fbo(fbo) @@ -1404,10 +1406,10 @@ QObject *QGLView::objectForPoint(const QPoint &point) if (!useBackBuffer) { QSize fbosize = QGL::nextPowerOfTwo(areaSize); if (!d->fbo) { - d->fbo = new QGLFramebufferObject(fbosize, QGLFramebufferObject::CombinedDepthStencil); + d->fbo = new QOpenGLFramebufferObject(fbosize, QOpenGLFramebufferObject::CombinedDepthStencil); } else if (d->fbo->size() != fbosize) { delete d->fbo; - d->fbo = new QGLFramebufferObject(fbosize, QGLFramebufferObject::CombinedDepthStencil); + d->fbo = new QOpenGLFramebufferObject(fbosize, QOpenGLFramebufferObject::CombinedDepthStencil); } } diff --git a/src/threed/viewing/qglview.h b/src/threed/viewing/qglview.h index eecc83d0e..6f3510bc5 100644 --- a/src/threed/viewing/qglview.h +++ b/src/threed/viewing/qglview.h @@ -45,7 +45,7 @@ #include "qglpainter.h" #include "qglcamera.h" -#include <QtGui/QWindow> +#include <QWindow> QT_BEGIN_HEADER diff --git a/tests/auto/threed/qgeometrydata/qgeometrydata.pro b/tests/auto/threed/qgeometrydata/qgeometrydata.pro index f2a624ed0..20526f1d8 100644 --- a/tests/auto/threed/qgeometrydata/qgeometrydata.pro +++ b/tests/auto/threed/qgeometrydata/qgeometrydata.pro @@ -8,6 +8,5 @@ INCLUDEPATH += ../../../shared INCLUDEPATH += ../../../../src/threed/geometry SOURCES += tst_qgeometrydata.cpp -QT += widgets CONFIG+=insignificant_test diff --git a/tests/auto/threed/qglabstractsurface/qglabstractsurface.pro b/tests/auto/threed/qglabstractsurface/qglabstractsurface.pro index 887e9b763..907752d62 100644 --- a/tests/auto/threed/qglabstractsurface/qglabstractsurface.pro +++ b/tests/auto/threed/qglabstractsurface/qglabstractsurface.pro @@ -5,6 +5,5 @@ QT += testlib qt3d CONFIG += warn_on SOURCES += tst_qglabstractsurface.cpp -QT += widgets CONFIG+=insignificant_test diff --git a/tests/auto/threed/qglabstractsurface/tst_qglabstractsurface.cpp b/tests/auto/threed/qglabstractsurface/tst_qglabstractsurface.cpp index d06d3eec4..82c6fa273 100644 --- a/tests/auto/threed/qglabstractsurface/tst_qglabstractsurface.cpp +++ b/tests/auto/threed/qglabstractsurface/tst_qglabstractsurface.cpp @@ -43,7 +43,11 @@ #include "qglabstractsurface.h" #include "qglwindowsurface.h" #include "qglframebufferobjectsurface.h" + +#ifdef QT_OPENGL_LIB #include "qglpixelbuffersurface.h" +#endif + #include "qglsubsurface.h" #include "qopenglfunctions.h" @@ -105,7 +109,9 @@ void tst_QGLAbstractSurface::glWindowSurface() QOpenGLContext ctx; ensureContext(glw, ctx); if (!ctx.isValid()) + { QSKIP("GL Implementation not valid"); + } QGLWindowSurface surface1; QVERIFY(surface1.surfaceType() == QGLAbstractSurface::Window); @@ -256,25 +262,25 @@ void tst_QGLAbstractSurface::pbufferSurface() QVERIFY(surface2.device() == &pbuffer1); QVERIFY(surface2.activate()); - QVERIFY(QGLContext::currentContext() != glw.context()); - const QGLContext *surface2ctx = QGLContext::currentContext(); + QVERIFY(QOpenGLContext::currentContext() != glw.context()); + const QOpenGLContext *surface2ctx = QOpenGLContext::currentContext(); QCOMPARE(surface2.viewportGL(), QRect(QPoint(0, 0), pbuffer1.size())); surface2.deactivate(); - QVERIFY(QGLContext::currentContext() == surface2ctx); // Left current. + QVERIFY(QOpenGLContext::currentContext() == surface2ctx); // Left current. QGLWidget glw2; QGLWindowSurface surface3(&glw2); QVERIFY(surface3.activate()); - QVERIFY(QGLContext::currentContext() == glw2.context()); + QVERIFY(QOpenGLContext::currentContext() == glw2.context()); QCOMPARE(surface3.viewportGL(), QRect(0, 0, glw2.width(), glw2.height())); QVERIFY(surface3.switchTo(&surface2)); - QVERIFY(QGLContext::currentContext() == surface2ctx); + QVERIFY(QOpenGLContext::currentContext() == surface2ctx); QCOMPARE(surface2.viewportGL(), QRect(QPoint(0, 0), pbuffer1.size())); QVERIFY(surface2.switchTo(&surface3)); - QVERIFY(QGLContext::currentContext() == glw2.context()); + QVERIFY(QOpenGLContext::currentContext() == glw2.context()); QCOMPARE(surface3.viewportGL(), QRect(0, 0, glw2.width(), glw2.height())); surface3.deactivate(); @@ -296,21 +302,21 @@ void tst_QGLAbstractSurface::pbufferSurface() QVERIFY(surface4.device() == &pbuffer2); QVERIFY(surface1.switchTo(&surface2)); - QVERIFY(QGLContext::currentContext() == surface2ctx); + QVERIFY(QOpenGLContext::currentContext() == surface2ctx); QCOMPARE(surface2.viewportGL(), QRect(QPoint(0, 0), pbuffer1.size())); QVERIFY(surface2.switchTo(&surface4)); - const QGLContext *surface4ctx = QGLContext::currentContext(); + const QOpenGLContext *surface4ctx = QOpenGLContext::currentContext(); QVERIFY(surface4ctx != glw.context()); QVERIFY(surface4ctx != surface2ctx); QCOMPARE(surface4.viewportGL(), QRect(QPoint(0, 0), pbuffer2.size())); QVERIFY(surface4.switchTo(&surface2)); - QVERIFY(QGLContext::currentContext() == surface2ctx); + QVERIFY(QOpenGLContext::currentContext() == surface2ctx); QCOMPARE(surface2.viewportGL(), QRect(QPoint(0, 0), pbuffer1.size())); QVERIFY(surface2.switchTo(&surface1)); - QVERIFY(QGLContext::currentContext() == glw.context()); + QVERIFY(QOpenGLContext::currentContext() == glw.context()); QCOMPARE(surface1.viewportGL(), QRect(0, 0, glw.width(), glw.height())); } */ diff --git a/tests/auto/threed/qglcolladafxeffectfactory/qglcolladafxeffectfactory.pro b/tests/auto/threed/qglcolladafxeffectfactory/qglcolladafxeffectfactory.pro index 1f7a7101d..0ed7bc2ea 100644 --- a/tests/auto/threed/qglcolladafxeffectfactory/qglcolladafxeffectfactory.pro +++ b/tests/auto/threed/qglcolladafxeffectfactory/qglcolladafxeffectfactory.pro @@ -2,7 +2,6 @@ TARGET = tst_qglcolladafxeffectfactory CONFIG += testcase TEMPLATE = app QT += testlib qt3d -QT += opengl CONFIG += warn_on diff --git a/tests/auto/threed/qglcolladafxeffectfactory/tst_qglcolladafxeffectfactory.cpp b/tests/auto/threed/qglcolladafxeffectfactory/tst_qglcolladafxeffectfactory.cpp index 878480331..1a228e980 100644 --- a/tests/auto/threed/qglcolladafxeffectfactory/tst_qglcolladafxeffectfactory.cpp +++ b/tests/auto/threed/qglcolladafxeffectfactory/tst_qglcolladafxeffectfactory.cpp @@ -41,9 +41,10 @@ #include <QtTest/QtTest> #include "qglcolladafxeffectfactory.h" + #include <QXmlStreamReader> #include <QColor> -#include "qgl.h" +#include <QOpenGLBuffer> QT_BEGIN_NAMESPACE class QGLColladaFxEffect; diff --git a/tests/auto/threed/qglindexbuffer/qglindexbuffer.pro b/tests/auto/threed/qglindexbuffer/qglindexbuffer.pro index 3b3b15714..25dbe2aaa 100644 --- a/tests/auto/threed/qglindexbuffer/qglindexbuffer.pro +++ b/tests/auto/threed/qglindexbuffer/qglindexbuffer.pro @@ -1,7 +1,7 @@ TARGET = tst_qglindexbuffer CONFIG += testcase TEMPLATE=app -QT += testlib qt3d opengl +QT += testlib qt3d CONFIG += warn_on SOURCES += tst_qglindexbuffer.cpp diff --git a/tests/auto/threed/qglindexbuffer/tst_qglindexbuffer.cpp b/tests/auto/threed/qglindexbuffer/tst_qglindexbuffer.cpp index fc012a525..f44b0fd01 100644 --- a/tests/auto/threed/qglindexbuffer/tst_qglindexbuffer.cpp +++ b/tests/auto/threed/qglindexbuffer/tst_qglindexbuffer.cpp @@ -41,7 +41,8 @@ #include <QtTest/QtTest> #include "qglindexbuffer.h" -#include "qopenglfunctions.h" + +#include <QOpenGLFunctions> class tst_QGLIndexBuffer : public QObject { @@ -79,7 +80,7 @@ void tst_QGLIndexBuffer::initTestCase() void tst_QGLIndexBuffer::create() { QGLIndexBuffer buf1; - QVERIFY(buf1.usagePattern() == QGLBuffer::StaticDraw); + QVERIFY(buf1.usagePattern() == QOpenGLBuffer::StaticDraw); QVERIFY(buf1.elementType() == GL_UNSIGNED_SHORT); QVERIFY(buf1.indexesUShort().isEmpty()); QVERIFY(buf1.indexesUInt().isEmpty()); @@ -90,7 +91,7 @@ void tst_QGLIndexBuffer::create() // Setting an index array as ushort must stay ushort. buf1.setIndexes(indexesUShort1024); - QVERIFY(buf1.usagePattern() == QGLBuffer::StaticDraw); + QVERIFY(buf1.usagePattern() == QOpenGLBuffer::StaticDraw); QVERIFY(buf1.elementType() == GL_UNSIGNED_SHORT); QVERIFY(buf1.indexesUShort() == indexesUShort1024); QVERIFY(buf1.indexesUInt().isEmpty()); @@ -102,7 +103,7 @@ void tst_QGLIndexBuffer::create() // Setting an index array as uint may convert to ushort on // embedded systems that don't have GL_OES_element_index_uint. buf1.setIndexes(indexesUInt1024); - QVERIFY(buf1.usagePattern() == QGLBuffer::StaticDraw); + QVERIFY(buf1.usagePattern() == QOpenGLBuffer::StaticDraw); if (buf1.elementType() == GL_UNSIGNED_SHORT) { QVERIFY(buf1.elementType() == GL_UNSIGNED_SHORT); QVERIFY(buf1.indexesUShort() == indexesUShort1024); @@ -119,7 +120,7 @@ void tst_QGLIndexBuffer::create() // Set back to ushort again. buf1.setIndexes(indexesUShort1024); - QVERIFY(buf1.usagePattern() == QGLBuffer::StaticDraw); + QVERIFY(buf1.usagePattern() == QOpenGLBuffer::StaticDraw); QVERIFY(buf1.elementType() == GL_UNSIGNED_SHORT); QVERIFY(buf1.indexesUShort() == indexesUShort1024); QVERIFY(buf1.indexesUInt().isEmpty()); diff --git a/tests/auto/threed/qglmaterial/qglmaterial.pro b/tests/auto/threed/qglmaterial/qglmaterial.pro index 02882f9a7..21da957f0 100644 --- a/tests/auto/threed/qglmaterial/qglmaterial.pro +++ b/tests/auto/threed/qglmaterial/qglmaterial.pro @@ -5,6 +5,5 @@ QT += testlib qt3d CONFIG += warn_on SOURCES += tst_qglmaterial.cpp -QT += widgets CONFIG+=insignificant_test diff --git a/tests/auto/threed/qglpainter/qglpainter.pro b/tests/auto/threed/qglpainter/qglpainter.pro index 81d19f68b..ec69275dc 100644 --- a/tests/auto/threed/qglpainter/qglpainter.pro +++ b/tests/auto/threed/qglpainter/qglpainter.pro @@ -14,6 +14,5 @@ SOURCES += tst_qglpainter.cpp \ HEADERS += qgltestwidget.h \ compareimage.h \ qglsimulator.h -QT+=widgets CONFIG+=insignificant_test diff --git a/tests/auto/threed/qglrender/qglrender.pro b/tests/auto/threed/qglrender/qglrender.pro index 92da88405..dfc3a95a4 100644 --- a/tests/auto/threed/qglrender/qglrender.pro +++ b/tests/auto/threed/qglrender/qglrender.pro @@ -5,6 +5,5 @@ QT += testlib qt3d CONFIG += warn_on SOURCES += tst_qglrender.cpp -QT+=widgets CONFIG+=insignificant_test diff --git a/tests/auto/threed/qglscenenode/qglscenenode.pro b/tests/auto/threed/qglscenenode/qglscenenode.pro index 489302ff5..d351fe5bc 100644 --- a/tests/auto/threed/qglscenenode/qglscenenode.pro +++ b/tests/auto/threed/qglscenenode/qglscenenode.pro @@ -6,6 +6,5 @@ CONFIG += warn_on INCLUDEPATH += ../../../shared SOURCES += tst_qglscenenode.cpp -QT+=widgets CONFIG+=insignificant_test diff --git a/tests/auto/threed/qglsharedresource/qglsharedresource.pro b/tests/auto/threed/qglsharedresource/qglsharedresource.pro index 4f1ed637d..93826e614 100644 --- a/tests/auto/threed/qglsharedresource/qglsharedresource.pro +++ b/tests/auto/threed/qglsharedresource/qglsharedresource.pro @@ -1,7 +1,7 @@ TARGET = tst_qglsharedresource CONFIG += testcase TEMPLATE=app -QT += testlib qt3d opengl widgets +QT += testlib qt3d opengl CONFIG += warn_on INCLUDEPATH += ../../../../src/threed/textures @@ -9,4 +9,3 @@ VPATH += ../../../../src/threed/textures HEADERS += qglsharedresource_p.h SOURCES += tst_qglsharedresource.cpp qglsharedresource.cpp -QT+=widgets diff --git a/tests/auto/threed/qglsharedresource/tst_qglsharedresource.cpp b/tests/auto/threed/qglsharedresource/tst_qglsharedresource.cpp index b2d5848bd..2a49b781e 100644 --- a/tests/auto/threed/qglsharedresource/tst_qglsharedresource.cpp +++ b/tests/auto/threed/qglsharedresource/tst_qglsharedresource.cpp @@ -40,6 +40,9 @@ ****************************************************************************/ #include <QtTest/QtTest> +#include <QPlatformOpenGLContext> + +#include "qglview.h" #include "qglsharedresource_p.h" class tst_QGLSharedResource : public QObject @@ -59,56 +62,65 @@ static int dummyDestroyCount = 0; static void destroyDummyResource(GLuint id) { QVERIFY(id != 0); - QVERIFY(QGLContext::currentContext() != 0); + QVERIFY(QOpenGLContext::currentContext() != 0); ++dummyDestroyCount; } void tst_QGLSharedResource::resourceSharing() { - QSKIP("failing since refactor changes"); dummyDestroyCount = 0; // Create a context. - QGLWidget *glw1 = new QGLWidget(); - glw1->makeCurrent(); + QGLView *view = new QGLView; + view->show(); + QOpenGLContext *ctx = view->context(); + bool ok; + ok = ctx->makeCurrent(view); + if (!ok) + QSKIP("Could not create an OpenGL context"); // Nothing should be sharing with glw1's context yet. - QVERIFY(!glw1->isSharing()); + QVERIFY(!ctx->handle()->isSharing()); // Create a guard for the first context. QGLSharedResource guard(destroyDummyResource); QVERIFY(guard.context() == 0); QVERIFY(guard.id() == 0); - guard.attach(glw1->context(), 3); - QVERIFY(guard.context() == glw1->context()); + guard.attach(ctx, 3); + QVERIFY(guard.context() == ctx); QVERIFY(guard.id() == 3); // Create another context that shares with the first. - QVERIFY(!glw1->isSharing()); - QGLWidget *glw2 = new QGLWidget(0, glw1); - if (!glw2->isSharing()) { - delete glw2; - delete glw1; + QVERIFY(!ctx->handle()->isSharing()); + + // Create a context. + QGLView *view2 = new QGLView; + view2->show(); + QOpenGLContext *ctx2 = view2->context(); + if (!ctx2 || !ctx2->makeCurrent(view2)) + QSKIP("Could not create an OpenGL context"); + + if (!ctx2->handle()->isSharing()) { QSKIP("Context sharing is not supported"); } - QVERIFY(glw1->isSharing()); - QVERIFY(glw1->context() != glw2->context()); + QVERIFY(ctx->handle()->isSharing()); + QVERIFY(ctx != ctx2); // Guard should still be the same. - QVERIFY(guard.context() == glw1->context()); + QVERIFY(guard.context() == ctx); QVERIFY(guard.id() == 3); // Create some guards and then destroy them while the context is active. { QGLSharedResource guard2(destroyDummyResource); - guard2.attach(glw1->context(), 4); - QVERIFY(guard2.context() == glw1->context()); + guard2.attach(ctx, 4); + QVERIFY(guard2.context() == ctx); QVERIFY(guard2.id() == 4); } QCOMPARE(dummyDestroyCount, 1); QGLSharedResource guard3(destroyDummyResource); - guard3.attach(glw1->context(), 6); - QVERIFY(guard3.context() == glw1->context()); + guard3.attach(ctx, 6); + QVERIFY(guard3.context() == ctx); QVERIFY(guard3.id() == 6); guard3.destroy(); QVERIFY(guard3.context() == 0); @@ -116,34 +128,39 @@ void tst_QGLSharedResource::resourceSharing() QCOMPARE(dummyDestroyCount, 2); // Create a third context, not sharing with the others. - QGLWidget *glw3 = new QGLWidget(); - QVERIFY(!glw3->isSharing()); + // Create a context. + QGLView *view3 = new QGLView; + view3->show(); + QOpenGLContext *ctx3 = view3->context(); + if (!ctx3 || !ctx3->makeCurrent(view3)) + QSKIP("Could not create an OpenGL context"); + QVERIFY(!ctx3->handle()->isSharing()); // Create a guard on the standalone context. QGLSharedResource guard4(destroyDummyResource); - guard4.attach(glw3->context(), 5); - QVERIFY(guard4.context() == glw3->context()); + guard4.attach(ctx3, 5); + QVERIFY(guard4.context() == ctx3); QVERIFY(guard4.id() == 5); // Shared guard should still be the same. - QVERIFY(guard.context() == glw1->context()); + QVERIFY(guard.context() == ctx); QVERIFY(guard.id() == 3); // Delete the first context. - delete glw1; + delete view; // The second context should no longer register as sharing. - QVERIFY(!glw2->isSharing()); + QVERIFY(!ctx2->handle()->isSharing()); // Shared guard should now be the second context, with the id the same. - QVERIFY(guard.context() == glw2->context()); + QVERIFY(guard.context() == ctx2); QVERIFY(guard.id() == 3); - QVERIFY(guard4.context() == glw3->context()); + QVERIFY(guard4.context() == ctx); QVERIFY(guard4.id() == 5); // Clean up the other contexts. - delete glw2; - delete glw3; + delete view2; + delete view3; // Guards should now be null and the id zero, but no extra calls to // the dummy destroy function. diff --git a/tests/auto/threed/qglvertexbundle/qglvertexbundle.pro b/tests/auto/threed/qglvertexbundle/qglvertexbundle.pro index a3e566c90..908d66a90 100644 --- a/tests/auto/threed/qglvertexbundle/qglvertexbundle.pro +++ b/tests/auto/threed/qglvertexbundle/qglvertexbundle.pro @@ -1,8 +1,7 @@ TARGET = tst_qglvertexbundle CONFIG += testcase TEMPLATE=app -QT += testlib qt3d opengl widgets +QT += testlib qt3d opengl CONFIG += warn_on SOURCES += tst_qglvertexbundle.cpp -QT+=widgets diff --git a/tests/auto/threed/qglvertexbundle/tst_qglvertexbundle.cpp b/tests/auto/threed/qglvertexbundle/tst_qglvertexbundle.cpp index f0baa9e44..c2237f78e 100644 --- a/tests/auto/threed/qglvertexbundle/tst_qglvertexbundle.cpp +++ b/tests/auto/threed/qglvertexbundle/tst_qglvertexbundle.cpp @@ -40,6 +40,8 @@ ****************************************************************************/ #include <QtTest/QtTest> + +#include "qglview.h" #include "qglvertexbundle.h" #include "qvector2darray.h" #include "qvector3darray.h" @@ -62,7 +64,6 @@ private slots: void tst_QGLVertexBundle::interleaved() { - QSKIP("QWidget: Cannot create a QWidget when no GUI is being used"); // Interleave 4 positions and texture co-ordinates, which will // result in the numbers 1..20 ending up in the GL server's buffer. QVector3DArray positions; @@ -99,8 +100,11 @@ void tst_QGLVertexBundle::interleaved() // with data before doing this to ensure that the client-side part of // the buffers can be created at application startup time before an // actual OpenGL context exists. - QGLWidget glw; - glw.makeCurrent(); + QGLView view; + view.show(); + QOpenGLContext *ctx = view.context(); + if (!ctx || !ctx->makeCurrent(&view)) + QSKIP("Could not create an OpenGL context"); // Upload the bundle and bail out if we couldn't upload it // (i.e. vertex buffers are not supported in the GL server). @@ -117,7 +121,7 @@ void tst_QGLVertexBundle::interleaved() QVERIFY(bundle.bind()); QCOMPARE(bundle.buffer().size(), int(sizeof(float) * 20)); float *mapped = reinterpret_cast<float *> - (bundle.buffer().map(QGLBuffer::ReadOnly)); + (bundle.buffer().map(QOpenGLBuffer::ReadOnly)); if (mapped) { for (int index = 0; index < 20; ++index) QCOMPARE(mapped[index], float(index + 1)); @@ -148,8 +152,11 @@ void tst_QGLVertexBundle::singleAttribute() QVERIFY(!bundle.isUploaded()); QCOMPARE(bundle.vertexCount(), 4); - QGLWidget glw; - glw.makeCurrent(); + QGLView view; + view.show(); + QOpenGLContext *ctx = view.context(); + if (!ctx || !ctx->makeCurrent(&view)) + QSKIP("Could not create an OpenGL context"); if (!bundle.upload()) { QVERIFY(!bundle.isUploaded()); @@ -160,7 +167,7 @@ void tst_QGLVertexBundle::singleAttribute() QVERIFY(bundle.bind()); QCOMPARE(bundle.buffer().size(), int(sizeof(float) * 12)); float *mapped = reinterpret_cast<float *> - (bundle.buffer().map(QGLBuffer::ReadOnly)); + (bundle.buffer().map(QOpenGLBuffer::ReadOnly)); if (mapped) { for (int index = 0; index < 12; ++index) QCOMPARE(mapped[index], float(index + 1)); @@ -176,8 +183,13 @@ void tst_QGLVertexBundle::large() positions.append(index * 5, index * 5 + 1, index * 5 + 2); texCoords.append(index * 5 + 3, index * 5 + 4); } - QGLWidget glw; - glw.makeCurrent(); + + QGLView view; + view.show(); + QOpenGLContext *ctx = view.context(); + if (!ctx || !ctx->makeCurrent(&view)) + QSKIP("Could not create an OpenGL context"); + QGLVertexBundle bundle; bundle.addAttribute(QGL::Position, positions); bundle.addAttribute(QGL::TextureCoord0, texCoords); @@ -189,7 +201,7 @@ void tst_QGLVertexBundle::large() QVERIFY(bundle.bind()); QCOMPARE(bundle.buffer().size(), int(sizeof(float) * 2048 * 5)); float *mapped = reinterpret_cast<float *> - (bundle.buffer().map(QGLBuffer::ReadOnly)); + (bundle.buffer().map(QOpenGLBuffer::ReadOnly)); if (mapped) { for (int index = 0; index < 2048 * 5; ++index) QCOMPARE(mapped[index], float(index)); @@ -211,8 +223,11 @@ void tst_QGLVertexBundle::otherAttributes() texCoords.append(15.0f); texCoords.append(20.0f); - QGLWidget glw; - glw.makeCurrent(); + QGLView view; + view.show(); + QOpenGLContext *ctx = view.context(); + if (!ctx || !ctx->makeCurrent(&view)) + QSKIP("Could not create an OpenGL context"); QGLVertexBundle bundle; bundle.addAttribute(QGL::Position, positions); @@ -225,7 +240,7 @@ void tst_QGLVertexBundle::otherAttributes() QVERIFY(bundle.bind()); QCOMPARE(bundle.buffer().size(), int(sizeof(float) * 20)); float *mapped = reinterpret_cast<float *> - (bundle.buffer().map(QGLBuffer::ReadOnly)); + (bundle.buffer().map(QOpenGLBuffer::ReadOnly)); if (mapped) { for (int index = 0; index < 20; ++index) QCOMPARE(mapped[index], float(index + 1)); @@ -249,7 +264,7 @@ void tst_QGLVertexBundle::otherAttributes() QVERIFY(bundle.bind()); QCOMPARE(bundle.buffer().size(), int(sizeof(uchar) * 256)); uchar *mapuchar = reinterpret_cast<uchar *> - (bundle.buffer().map(QGLBuffer::ReadOnly)); + (bundle.buffer().map(QOpenGLBuffer::ReadOnly)); if (mapuchar) { for (int index = 0; index < 256; ++index) QCOMPARE(mapuchar[index], uchar(index)); @@ -269,7 +284,7 @@ void tst_QGLVertexBundle::otherAttributes() QVERIFY(bundle.bind()); QCOMPARE(bundle.buffer().size(), int(sizeof(float) * 4)); mapped = reinterpret_cast<float *> - (bundle.buffer().map(QGLBuffer::ReadOnly)); + (bundle.buffer().map(QOpenGLBuffer::ReadOnly)); if (mapped) { for (int index = 0; index < 4; ++index) QCOMPARE(mapped[index], float((index + 1) * 5)); diff --git a/tests/auto/threed/qsphere3d/qsphere3d.pro b/tests/auto/threed/qsphere3d/qsphere3d.pro index cc6feb0a4..e35abbdb7 100644 --- a/tests/auto/threed/qsphere3d/qsphere3d.pro +++ b/tests/auto/threed/qsphere3d/qsphere3d.pro @@ -2,6 +2,5 @@ TARGET = tst_qsphere3d CONFIG += testcase TEMPLATE=app QT += testlib qt3d -QT += opengl CONFIG += warn_on SOURCES += tst_qsphere3d.cpp diff --git a/tests/auto/threed/qvectorarray/qvectorarray.pro b/tests/auto/threed/qvectorarray/qvectorarray.pro index 783fa88d8..485e09f2c 100644 --- a/tests/auto/threed/qvectorarray/qvectorarray.pro +++ b/tests/auto/threed/qvectorarray/qvectorarray.pro @@ -2,7 +2,6 @@ TARGET = tst_qvectorarray CONFIG += testcase TEMPLATE=app QT += testlib qt3d -QT += opengl CONFIG += warn_on diff --git a/tests/benchmarks/benchmarks.pro b/tests/benchmarks/benchmarks.pro index 6c00e7ae4..a2eac4ed5 100644 --- a/tests/benchmarks/benchmarks.pro +++ b/tests/benchmarks/benchmarks.pro @@ -1,4 +1,5 @@ TEMPLATE = subdirs -SUBDIRS = qarray \ - qglbuilder_perf -contains(QT_CONFIG, declarative):SUBDIRS += matrix_properties +SUBDIRS = \ + qarray \ + qglbuilder_perf \ + matrix_properties diff --git a/tests/manual/animations/animations.pro b/tests/manual/animations/animations.pro index 74065399f..e990836be 100644 --- a/tests/manual/animations/animations.pro +++ b/tests/manual/animations/animations.pro @@ -7,7 +7,3 @@ QT += qt3dquick SOURCES += main.cpp INSTALL_DIRS = qml - -CONFIG += qt3d_deploy_qml qt3dquick_deploy_pkg -include(../../../pkg.pri) -qtcAddDeployment() diff --git a/tests/manual/animations/icon-l-qtquick3d.png b/tests/manual/animations/icon-l-qtquick3d.png Binary files differdeleted file mode 100644 index 69deef3f6..000000000 --- a/tests/manual/animations/icon-l-qtquick3d.png +++ /dev/null diff --git a/tests/manual/animations/m5-tst_animations_qml.desktop b/tests/manual/animations/m5-tst_animations_qml.desktop deleted file mode 100644 index 0ea204c9e..000000000 --- a/tests/manual/animations/m5-tst_animations_qml.desktop +++ /dev/null @@ -1,14 +0,0 @@ -[Desktop Entry] -Encoding=UTF-8 -Version=1.0 -Name=tst_animations -Comment=Qt3D test animations application -Exec=/usr/bin/tst_animations -fullscreen -Icon=icon-l-qtquick3d -Terminal=false -Type=Application -Categories=Development; -X-HildonDesk-ShowInToolbar=true -X-Osso-Type=application/x-executable -X-Text-Domain=qt3d - diff --git a/tests/manual/animations/tst_animations_qml.desktop b/tests/manual/animations/tst_animations_qml.desktop deleted file mode 100644 index b8aebcb47..000000000 --- a/tests/manual/animations/tst_animations_qml.desktop +++ /dev/null @@ -1,8 +0,0 @@ -[Desktop Entry] -Type=Application -Name=tst_animations -Icon=icon-l-qtquick3d -Exec=/usr/bin/tst_animations -fullscreen -OnlyShowIn=X-MeeGo; -X-MeeGo-Logical-Id=qtn_comm_appname_tst_animations_qml -X-MeeGo-Translation-Catalog=essentials diff --git a/tests/manual/background/background.pro b/tests/manual/background/background.pro index 9908f1999..755becefb 100644 --- a/tests/manual/background/background.pro +++ b/tests/manual/background/background.pro @@ -6,7 +6,3 @@ QT += declarative quick SOURCES += main.cpp INSTALL_DIRS = qml - -CONFIG += qt3d_deploy_qml -include(../../../pkg.pri) -qtcAddDeployment() diff --git a/tests/manual/background/icon-l-qtquick3d.png b/tests/manual/background/icon-l-qtquick3d.png Binary files differdeleted file mode 100644 index 69deef3f6..000000000 --- a/tests/manual/background/icon-l-qtquick3d.png +++ /dev/null diff --git a/tests/manual/basic/basic.pro b/tests/manual/basic/basic.pro index 964cbc724..e3134cd16 100644 --- a/tests/manual/basic/basic.pro +++ b/tests/manual/basic/basic.pro @@ -6,7 +6,3 @@ QT += declarative quick SOURCES += main.cpp INSTALL_DIRS = qml - -CONFIG += qt3d_deploy_qml -include(../../../pkg.pri) -qtcAddDeployment() diff --git a/tests/manual/basic/icon-l-qtquick3d.png b/tests/manual/basic/icon-l-qtquick3d.png Binary files differdeleted file mode 100644 index 69deef3f6..000000000 --- a/tests/manual/basic/icon-l-qtquick3d.png +++ /dev/null diff --git a/tests/manual/displaymodel/displaymodel.pro b/tests/manual/displaymodel/displaymodel.pro index 3bda8dccc..6daf1e70b 100644 --- a/tests/manual/displaymodel/displaymodel.pro +++ b/tests/manual/displaymodel/displaymodel.pro @@ -7,7 +7,3 @@ QT += qt3dquick SOURCES += main.cpp INSTALL_DIRS = qml - -CONFIG += qt3d_deploy_qml qt3dquick_deploy_pkg -include(../../../pkg.pri) -qtcAddDeployment() diff --git a/tests/manual/displaymodel/icon-l-qtquick3d.png b/tests/manual/displaymodel/icon-l-qtquick3d.png Binary files differdeleted file mode 100644 index 69deef3f6..000000000 --- a/tests/manual/displaymodel/icon-l-qtquick3d.png +++ /dev/null diff --git a/tests/manual/fullreferencing/fullreferencing.pro b/tests/manual/fullreferencing/fullreferencing.pro index fead7f3a6..8a1a769f6 100644 --- a/tests/manual/fullreferencing/fullreferencing.pro +++ b/tests/manual/fullreferencing/fullreferencing.pro @@ -6,7 +6,3 @@ QT += declarative quick SOURCES += main.cpp INSTALL_DIRS = qml - -CONFIG += qt3d_deploy_qml -include(../../../pkg.pri) -qtcAddDeployment() diff --git a/tests/manual/fullreferencing/icon-l-qtquick3d.png b/tests/manual/fullreferencing/icon-l-qtquick3d.png Binary files differdeleted file mode 100644 index 69deef3f6..000000000 --- a/tests/manual/fullreferencing/icon-l-qtquick3d.png +++ /dev/null diff --git a/tests/manual/model3ds/icon-l-qtquick3d.png b/tests/manual/model3ds/icon-l-qtquick3d.png Binary files differdeleted file mode 100644 index 69deef3f6..000000000 --- a/tests/manual/model3ds/icon-l-qtquick3d.png +++ /dev/null diff --git a/tests/manual/model3ds/m5-tst_submesh_qml.desktop b/tests/manual/model3ds/m5-tst_submesh_qml.desktop deleted file mode 100644 index 537f1e8cd..000000000 --- a/tests/manual/model3ds/m5-tst_submesh_qml.desktop +++ /dev/null @@ -1,14 +0,0 @@ -[Desktop Entry] -Encoding=UTF-8 -Version=1.0 -Name=tst_submesh -Comment=Qt3D test application -Exec=/usr/bin/tst_submesh -fullscreen -Icon=icon-l-qtquick3d -Terminal=false -Type=Application -Categories=Development; -X-HildonDesk-ShowInToolbar=true -X-Osso-Type=application/x-executable -X-Text-Domain=qt3d - diff --git a/tests/manual/model3ds/model3ds.pro b/tests/manual/model3ds/model3ds.pro index 7c352d7d0..66ffe9657 100644 --- a/tests/manual/model3ds/model3ds.pro +++ b/tests/manual/model3ds/model3ds.pro @@ -7,7 +7,3 @@ QT += qt3dquick SOURCES += main.cpp INSTALL_DIRS = qml - -CONFIG += qt3d_deploy_qml qt3dquick_deploy_pkg -include(../../../pkg.pri) -qtcAddDeployment() diff --git a/tests/manual/model3ds/tst_submesh_qml.desktop b/tests/manual/model3ds/tst_submesh_qml.desktop deleted file mode 100644 index 361fd36ec..000000000 --- a/tests/manual/model3ds/tst_submesh_qml.desktop +++ /dev/null @@ -1,8 +0,0 @@ -[Desktop Entry] -Type=Application -Name=tst_submesh -Icon=icon-l-qtquick3d -Exec=/usr/bin/tst_submesh -fullscreen -OnlyShowIn=X-MeeGo; -X-MeeGo-Logical-Id=qtn_comm_appname_tst_submesh_qml -X-MeeGo-Translation-Catalog=essentials diff --git a/tests/manual/navigation1/icon-l-qtquick3d.png b/tests/manual/navigation1/icon-l-qtquick3d.png Binary files differdeleted file mode 100644 index 69deef3f6..000000000 --- a/tests/manual/navigation1/icon-l-qtquick3d.png +++ /dev/null diff --git a/tests/manual/navigation1/navigation1.pro b/tests/manual/navigation1/navigation1.pro index 63e690143..923a3419b 100644 --- a/tests/manual/navigation1/navigation1.pro +++ b/tests/manual/navigation1/navigation1.pro @@ -7,7 +7,3 @@ QT += qt3dquick SOURCES += main.cpp INSTALL_DIRS = qml - -CONFIG += qt3d_deploy_qml qt3dquick_deploy_pkg -include(../../../pkg.pri) -qtcAddDeployment() diff --git a/tests/manual/qrc/icon-l-qtquick3d.png b/tests/manual/qrc/icon-l-qtquick3d.png Binary files differdeleted file mode 100644 index 69deef3f6..000000000 --- a/tests/manual/qrc/icon-l-qtquick3d.png +++ /dev/null diff --git a/tests/manual/qrc/m5-tst_qrc_qml.desktop b/tests/manual/qrc/m5-tst_qrc_qml.desktop deleted file mode 100644 index 1484a0ff3..000000000 --- a/tests/manual/qrc/m5-tst_qrc_qml.desktop +++ /dev/null @@ -1,14 +0,0 @@ -[Desktop Entry] -Encoding=UTF-8 -Version=1.0 -Name=tst_submesh -Comment=Qt3D test application -Exec=/usr/bin/tst_qrc -fullscreen -Icon=icon-l-qtquick3d -Terminal=false -Type=Application -Categories=Development; -X-HildonDesk-ShowInToolbar=true -X-Osso-Type=application/x-executable -X-Text-Domain=qt3d - diff --git a/tests/manual/qrc/qrc.pro b/tests/manual/qrc/qrc.pro index 401b41ecb..97aa7fb8f 100644 --- a/tests/manual/qrc/qrc.pro +++ b/tests/manual/qrc/qrc.pro @@ -8,10 +8,6 @@ SOURCES += main.cpp INSTALL_DIRS = qml -CONFIG += qt3d_deploy_qml qt3dquick_deploy_pkg -include(../../../pkg.pri) -qtcAddDeployment() - OTHER_FILES += \ qml/tst_cube.qml diff --git a/tests/manual/qrc/tst_qrc_qml.desktop b/tests/manual/qrc/tst_qrc_qml.desktop deleted file mode 100644 index aa5d520dc..000000000 --- a/tests/manual/qrc/tst_qrc_qml.desktop +++ /dev/null @@ -1,8 +0,0 @@ -[Desktop Entry] -Type=Application -Name=tst_qrc -Icon=icon-l-qtquick3d -Exec=/usr/bin/tst_qrc -fullscreen -OnlyShowIn=X-MeeGo; -X-MeeGo-Logical-Id=qtn_comm_appname_tst_qrc_qml -X-MeeGo-Translation-Catalog=essentials diff --git a/tests/manual/rotation/icon-l-qtquick3d.png b/tests/manual/rotation/icon-l-qtquick3d.png Binary files differdeleted file mode 100644 index 69deef3f6..000000000 --- a/tests/manual/rotation/icon-l-qtquick3d.png +++ /dev/null diff --git a/tests/manual/rotation/m5-tst_rotation_qml.desktop b/tests/manual/rotation/m5-tst_rotation_qml.desktop deleted file mode 100644 index 687c7ee1e..000000000 --- a/tests/manual/rotation/m5-tst_rotation_qml.desktop +++ /dev/null @@ -1,14 +0,0 @@ -[Desktop Entry] -Encoding=UTF-8 -Version=1.0 -Name=tst_rotation -Comment=Qt3D test application -Exec=/usr/bin/tst_rotation -fullscreen -Icon=icon-l-qtquick3d -Terminal=false -Type=Application -Categories=Development; -X-HildonDesk-ShowInToolbar=true -X-Osso-Type=application/x-executable -X-Text-Domain=qt3d - diff --git a/tests/manual/rotation/rotation.pro b/tests/manual/rotation/rotation.pro index 62a93fd30..f734327be 100644 --- a/tests/manual/rotation/rotation.pro +++ b/tests/manual/rotation/rotation.pro @@ -7,7 +7,3 @@ QT += qt3dquick SOURCES += main.cpp INSTALL_DIRS = qml - -CONFIG += qt3d_deploy_qml qt3dquick_deploy_pkg -include(../../../pkg.pri) -qtcAddDeployment() diff --git a/tests/manual/rotation/tst_rotation_qml.desktop b/tests/manual/rotation/tst_rotation_qml.desktop deleted file mode 100644 index e5675b137..000000000 --- a/tests/manual/rotation/tst_rotation_qml.desktop +++ /dev/null @@ -1,8 +0,0 @@ -[Desktop Entry] -Type=Application -Name=tst_rotation -Icon=icon-l-qtquick3d -Exec=/usr/bin/tst_rotation -fullscreen -OnlyShowIn=X-MeeGo; -X-MeeGo-Logical-Id=qtn_comm_appname_tst_rotation_qml -X-MeeGo-Translation-Catalog=essentials diff --git a/tests/manual/scaling/icon-l-qtquick3d.png b/tests/manual/scaling/icon-l-qtquick3d.png Binary files differdeleted file mode 100644 index 69deef3f6..000000000 --- a/tests/manual/scaling/icon-l-qtquick3d.png +++ /dev/null diff --git a/tests/manual/scaling/m5-tst_scaling_qml.desktop b/tests/manual/scaling/m5-tst_scaling_qml.desktop deleted file mode 100644 index 7b9cc9437..000000000 --- a/tests/manual/scaling/m5-tst_scaling_qml.desktop +++ /dev/null @@ -1,14 +0,0 @@ -[Desktop Entry] -Encoding=UTF-8 -Version=1.0 -Name=tst_scaling -Comment=Qt3D test application -Exec=/usr/bin/tst_scaling -fullscreen -Icon=icon-l-qtquick3d -Terminal=false -Type=Application -Categories=Development; -X-HildonDesk-ShowInToolbar=true -X-Osso-Type=application/x-executable -X-Text-Domain=qt3d - diff --git a/tests/manual/scaling/scaling.pro b/tests/manual/scaling/scaling.pro index 045de2911..4b7ab3a87 100644 --- a/tests/manual/scaling/scaling.pro +++ b/tests/manual/scaling/scaling.pro @@ -7,7 +7,3 @@ QT += qt3dquick SOURCES += main.cpp INSTALL_DIRS = qml - -CONFIG += qt3d_deploy_qml qt3dquick_deploy_pkg -include(../../../pkg.pri) -qtcAddDeployment() diff --git a/tests/manual/scaling/tst_scaling_qml.desktop b/tests/manual/scaling/tst_scaling_qml.desktop deleted file mode 100644 index 293a5feef..000000000 --- a/tests/manual/scaling/tst_scaling_qml.desktop +++ /dev/null @@ -1,8 +0,0 @@ -[Desktop Entry] -Type=Application -Name=tst_scaling -Icon=icon-l-qtquick3d -Exec=/usr/bin/tst_scaling -fullscreen -OnlyShowIn=X-MeeGo; -X-MeeGo-Logical-Id=qtn_comm_appname_tst_scaling_qml -X-MeeGo-Translation-Catalog=essentials diff --git a/tests/manual/submesh/icon-l-qtquick3d.png b/tests/manual/submesh/icon-l-qtquick3d.png Binary files differdeleted file mode 100644 index 69deef3f6..000000000 --- a/tests/manual/submesh/icon-l-qtquick3d.png +++ /dev/null diff --git a/tests/manual/submesh/m5-tst_submesh_qml.desktop b/tests/manual/submesh/m5-tst_submesh_qml.desktop deleted file mode 100644 index 537f1e8cd..000000000 --- a/tests/manual/submesh/m5-tst_submesh_qml.desktop +++ /dev/null @@ -1,14 +0,0 @@ -[Desktop Entry] -Encoding=UTF-8 -Version=1.0 -Name=tst_submesh -Comment=Qt3D test application -Exec=/usr/bin/tst_submesh -fullscreen -Icon=icon-l-qtquick3d -Terminal=false -Type=Application -Categories=Development; -X-HildonDesk-ShowInToolbar=true -X-Osso-Type=application/x-executable -X-Text-Domain=qt3d - diff --git a/tests/manual/submesh/submesh.pro b/tests/manual/submesh/submesh.pro index 490531488..04142c83b 100644 --- a/tests/manual/submesh/submesh.pro +++ b/tests/manual/submesh/submesh.pro @@ -7,7 +7,3 @@ QT += qt3dquick SOURCES += main.cpp INSTALL_DIRS = qml - -CONFIG += qt3d_deploy_qml qt3dquick_deploy_pkg -include(../../../pkg.pri) -qtcAddDeployment() diff --git a/tests/manual/submesh/tst_submesh_qml.desktop b/tests/manual/submesh/tst_submesh_qml.desktop deleted file mode 100644 index 361fd36ec..000000000 --- a/tests/manual/submesh/tst_submesh_qml.desktop +++ /dev/null @@ -1,8 +0,0 @@ -[Desktop Entry] -Type=Application -Name=tst_submesh -Icon=icon-l-qtquick3d -Exec=/usr/bin/tst_submesh -fullscreen -OnlyShowIn=X-MeeGo; -X-MeeGo-Logical-Id=qtn_comm_appname_tst_submesh_qml -X-MeeGo-Translation-Catalog=essentials diff --git a/tests/manual/transformations/icon-l-qtquick3d.png b/tests/manual/transformations/icon-l-qtquick3d.png Binary files differdeleted file mode 100644 index 69deef3f6..000000000 --- a/tests/manual/transformations/icon-l-qtquick3d.png +++ /dev/null diff --git a/tests/manual/transformations/m5-tst_transformations_qml.desktop b/tests/manual/transformations/m5-tst_transformations_qml.desktop deleted file mode 100644 index 13fc93c6d..000000000 --- a/tests/manual/transformations/m5-tst_transformations_qml.desktop +++ /dev/null @@ -1,14 +0,0 @@ -[Desktop Entry] -Encoding=UTF-8 -Version=1.0 -Name=tst_transformations -Comment=Qt3D test application -Exec=/usr/bin/tst_transformations -fullscreen -Icon=icon-l-qtquick3d -Terminal=false -Type=Application -Categories=Development; -X-HildonDesk-ShowInToolbar=true -X-Osso-Type=application/x-executable -X-Text-Domain=qt3d - diff --git a/tests/manual/transformations/transformations.pro b/tests/manual/transformations/transformations.pro index f3b0fe04c..44d0071e9 100644 --- a/tests/manual/transformations/transformations.pro +++ b/tests/manual/transformations/transformations.pro @@ -7,7 +7,3 @@ QT += qt3dquick SOURCES += main.cpp INSTALL_DIRS = qml - -CONFIG += qt3d_deploy_qml qt3dquick_deploy_pkg -include(../../../pkg.pri) -qtcAddDeployment() diff --git a/tests/manual/transformations/tst_transformations_qml.desktop b/tests/manual/transformations/tst_transformations_qml.desktop deleted file mode 100644 index f26dac55a..000000000 --- a/tests/manual/transformations/tst_transformations_qml.desktop +++ /dev/null @@ -1,8 +0,0 @@ -[Desktop Entry] -Type=Application -Name=tst_transformations -Icon=icon-l-qtquick3d -Exec=/usr/bin/tst_transformations -fullscreen -OnlyShowIn=X-MeeGo; -X-MeeGo-Logical-Id=qtn_comm_appname_tst_transformations_qml -X-MeeGo-Translation-Catalog=essentials diff --git a/tests/manual/translation/icon-l-qtquick3d.png b/tests/manual/translation/icon-l-qtquick3d.png Binary files differdeleted file mode 100644 index 69deef3f6..000000000 --- a/tests/manual/translation/icon-l-qtquick3d.png +++ /dev/null diff --git a/tests/manual/translation/m5-tst_translation_qml.desktop b/tests/manual/translation/m5-tst_translation_qml.desktop deleted file mode 100644 index aaaa76ebd..000000000 --- a/tests/manual/translation/m5-tst_translation_qml.desktop +++ /dev/null @@ -1,14 +0,0 @@ -[Desktop Entry] -Encoding=UTF-8 -Version=1.0 -Name=tst_translation -Comment=Qt3D test application -Exec=/usr/bin/tst_translation -fullscreen -Icon=icon-l-qtquick3d -Terminal=false -Type=Application -Categories=Development; -X-HildonDesk-ShowInToolbar=true -X-Osso-Type=application/x-executable -X-Text-Domain=qt3d - diff --git a/tests/manual/translation/translation.pro b/tests/manual/translation/translation.pro index e2b3f1fb7..18c601957 100644 --- a/tests/manual/translation/translation.pro +++ b/tests/manual/translation/translation.pro @@ -7,7 +7,3 @@ QT += qt3dquick SOURCES += main.cpp INSTALL_DIRS = qml - -CONFIG += qt3d_deploy_qml qt3dquick_deploy_pkg -include(../../../pkg.pri) -qtcAddDeployment() diff --git a/tests/manual/translation/tst_translation_qml.desktop b/tests/manual/translation/tst_translation_qml.desktop deleted file mode 100644 index 23c5ac8d1..000000000 --- a/tests/manual/translation/tst_translation_qml.desktop +++ /dev/null @@ -1,8 +0,0 @@ -[Desktop Entry] -Type=Application -Name=tst_translation -Icon=icon-l-qtquick3d -Exec=/usr/bin/tst_translation -fullscreen -OnlyShowIn=X-MeeGo; -X-MeeGo-Logical-Id=qtn_comm_appname_tst_translation_qml -X-MeeGo-Translation-Catalog=essentials diff --git a/tests/shared/qmlres.h b/tests/shared/qmlres.h index 58b15c36d..b6db62462 100644 --- a/tests/shared/qmlres.h +++ b/tests/shared/qmlres.h @@ -43,11 +43,11 @@ #ifndef QMLRES_H #define QMLRES_H -#include <QtCore/qdir.h> -#include <QtGui/QGuiApplication> -#include <QtDeclarative/QQuickView> +#include <QDir> +#include <QGuiApplication> +#include <QQuickView> -#include <QtCore/qdebug.h> +#include <QDebug> #define internal_xstr(s) internal_str(s) #define internal_str(s) #s diff --git a/tests/shared/qtest_helpers.h b/tests/shared/qtest_helpers.h index e9040e938..b32be7a28 100644 --- a/tests/shared/qtest_helpers.h +++ b/tests/shared/qtest_helpers.h @@ -65,7 +65,7 @@ namespace QTest { char *toString(const QVector4D &v) { char *msg = new char[128]; - qt_snprintf(msg, 128, "(%0.4f, %0.4f, %0.4f, %0.4f)", + qsnprintf(msg, 128, "(%0.4f, %0.4f, %0.4f, %0.4f)", v.x(), v.y(), v.z(), v.w()); return msg; } @@ -73,21 +73,21 @@ namespace QTest { char *toString(const QVector3D &v) { char *msg = new char[128]; - qt_snprintf(msg, 128, "(%0.4f, %0.4f, %0.4f)", v.x(), v.y(), v.z()); + qsnprintf(msg, 128, "(%0.4f, %0.4f, %0.4f)", v.x(), v.y(), v.z()); return msg; } char *toString(const QVector2D &v) { char *msg = new char[128]; - qt_snprintf(msg, 128, "(%0.4f, %0.4f)", v.x(), v.y()); + qsnprintf(msg, 128, "(%0.4f, %0.4f)", v.x(), v.y()); return msg; } char *toString(const QColor4ub &c) { char *msg = new char[128]; - qt_snprintf(msg, 128, "R: %0.2f, G: %0.2f, B: %0.2f, A: %0.2)", + qsnprintf(msg, 128, "R: %0.2f, G: %0.2f, B: %0.2f, A: %0.2)", c.redF(), c.greenF(), c.blueF(), c.alphaF()); return msg; } diff --git a/tests/tests.pro b/tests/tests.pro index cfab8452e..24db71db9 100644 --- a/tests/tests.pro +++ b/tests/tests.pro @@ -1,4 +1,3 @@ TEMPLATE = subdirs SUBDIRS = manual -include(../pkg.pri) !package: SUBDIRS += auto benchmarks diff --git a/tutorials/quick3d/teapot_bounce_qml/m5-teapot_bounce_qml.desktop b/tutorials/quick3d/teapot_bounce_qml/m5-teapot_bounce_qml.desktop deleted file mode 100644 index 75214a26a..000000000 --- a/tutorials/quick3d/teapot_bounce_qml/m5-teapot_bounce_qml.desktop +++ /dev/null @@ -1,14 +0,0 @@ -[Desktop Entry] -Encoding=UTF-8 -Version=1.0 -Name=Teapot Bounce -Comment=Qt3D example application -Exec=/usr/bin/teapot_bounce_qml -fullscreen -Icon=icon-l-qtquick3d -Terminal=false -Type=Application -Categories=Development; -X-HildonDesk-ShowInToolbar=true -X-Osso-Type=application/x-executable -X-Text-Domain=qt3d - diff --git a/tutorials/quick3d/teapot_bounce_qml/main.cpp b/tutorials/quick3d/teapot_bounce_qml/main.cpp index 848059216..810bf72c3 100644 --- a/tutorials/quick3d/teapot_bounce_qml/main.cpp +++ b/tutorials/quick3d/teapot_bounce_qml/main.cpp @@ -39,8 +39,8 @@ ** ****************************************************************************/ -#include <QtGui/QGuiApplication> -#include <QtQuick/qquickview.h> +#include <QGuiApplication> +#include <QQuickView> #include "../qmlres.h" diff --git a/tutorials/quick3d/teapot_bounce_qml/teapot_bounce_qml.desktop b/tutorials/quick3d/teapot_bounce_qml/teapot_bounce_qml.desktop deleted file mode 100644 index 14bbdce87..000000000 --- a/tutorials/quick3d/teapot_bounce_qml/teapot_bounce_qml.desktop +++ /dev/null @@ -1,8 +0,0 @@ -[Desktop Entry] -Type=Application -Name=Teapot Bounce -Icon=icon-l-qtquick3d -Exec=/usr/bin/teapot_bounce_qml -fullscreen -OnlyShowIn=X-MeeGo; -X-MeeGo-Logical-Id=qtn_comm_appname_teapot_bounce_qml -X-MeeGo-Translation-Catalog=essentials diff --git a/tutorials/quick3d/teapot_bounce_qml/teapot_bounce_qml.pro b/tutorials/quick3d/teapot_bounce_qml/teapot_bounce_qml.pro index 7db5ca199..0c69061cf 100644 --- a/tutorials/quick3d/teapot_bounce_qml/teapot_bounce_qml.pro +++ b/tutorials/quick3d/teapot_bounce_qml/teapot_bounce_qml.pro @@ -2,15 +2,8 @@ TEMPLATE = app TARGET = teapot_bounce_qml CONFIG += qt warn_on -QT += declarative quick qt3dquick +QT += qt3d quick SOURCES += main.cpp HEADERS += ../qmlres.h -DESTDIR = ../../../bin - -INSTALL_DIRS = qml - -CONFIG += qt3d_deploy_qml -include(../../../pkg.pri) -qtcAddDeployment() diff --git a/tutorials/quick3d/teapot_qml/m5-teapot_qml.desktop b/tutorials/quick3d/teapot_qml/m5-teapot_qml.desktop deleted file mode 100644 index e5a298e67..000000000 --- a/tutorials/quick3d/teapot_qml/m5-teapot_qml.desktop +++ /dev/null @@ -1,14 +0,0 @@ -[Desktop Entry] -Encoding=UTF-8 -Version=1.0 -Name=Teapot -Comment=Qt3D example application -Exec=/usr/bin/teapot_qml -fullscreen -Icon=icon-l-qtquick3d -Terminal=false -Type=Application -Categories=Development; -X-HildonDesk-ShowInToolbar=true -X-Osso-Type=application/x-executable -X-Text-Domain=qt3d - diff --git a/tutorials/quick3d/teapot_qml/main.cpp b/tutorials/quick3d/teapot_qml/main.cpp index 5c7a7f651..d5daefd1e 100644 --- a/tutorials/quick3d/teapot_qml/main.cpp +++ b/tutorials/quick3d/teapot_qml/main.cpp @@ -39,8 +39,8 @@ ** ****************************************************************************/ -#include <QtGui/QGuiApplication> -#include <QtDeclarative/qquickview.h> +#include <QGuiApplication> +#include <QQuickView> #include "../qmlres.h" diff --git a/tutorials/quick3d/teapot_qml/teapot_qml.desktop b/tutorials/quick3d/teapot_qml/teapot_qml.desktop deleted file mode 100644 index 733cb7936..000000000 --- a/tutorials/quick3d/teapot_qml/teapot_qml.desktop +++ /dev/null @@ -1,8 +0,0 @@ -[Desktop Entry] -Type=Application -Name=Teapot -Icon=icon-l-qtquick3d -Exec=/usr/bin/teapot_qml -fullscreen -OnlyShowIn=X-MeeGo; -X-MeeGo-Logical-Id=qtn_comm_appname_teapot_qml -X-MeeGo-Translation-Catalog=essentials diff --git a/tutorials/quick3d/teapot_qml/teapot_qml.pro b/tutorials/quick3d/teapot_qml/teapot_qml.pro index 72b29256d..022d075ba 100644 --- a/tutorials/quick3d/teapot_qml/teapot_qml.pro +++ b/tutorials/quick3d/teapot_qml/teapot_qml.pro @@ -2,15 +2,7 @@ TEMPLATE = app TARGET = teapot_qml CONFIG += qt warn_on -QT += declarative quick qt3dquick +QT += qt3d quick SOURCES += main.cpp HEADERS += ../qmlres.h - -DESTDIR = ../../../bin - -INSTALL_DIRS = qml - -CONFIG += qt3d_deploy_qml -include(../../../pkg.pri) -qtcAddDeployment() diff --git a/util/qt3d/qglinfo/fpswidget.h b/util/qt3d/qglinfo/fpswidget.h index a72f62ff8..1d300ad94 100644 --- a/util/qt3d/qglinfo/fpswidget.h +++ b/util/qt3d/qglinfo/fpswidget.h @@ -46,7 +46,7 @@ #if defined(QT_OPENGL_ES_2) #include <QtGui/qvector3d.h> #include <QtGui/qmatrix4x4.h> -#include <QtOpenGL/qglshaderprogram.h> +#include <QOpenGLShaderProgram> #endif class QTime; diff --git a/util/qt3d/qglinfo/qglinfo.cpp b/util/qt3d/qglinfo/qglinfo.cpp index 3652e0ff5..5e67d5ed7 100644 --- a/util/qt3d/qglinfo/qglinfo.cpp +++ b/util/qt3d/qglinfo/qglinfo.cpp @@ -44,7 +44,7 @@ #include <QtOpenGL/qgl.h> #include <QtOpenGL/qglpixelbuffer.h> #include <QtOpenGL/qglframebufferobject.h> -#include <QtOpenGL/qglshaderprogram.h> +#include <QOpenGLShaderProgram> #include <QtCore/qtimer.h> #include <QtCore/qdatetime.h> @@ -224,10 +224,10 @@ QString QGLInfo::reportQtGLFeatures() const d += printBool("QGLFormat::hasOpenGL: ", QGLFormat::hasOpenGL()); d += printBool("QGLFormat::hasOpenGLOverlays: ", QGLFormat::hasOpenGLOverlays()); d += printBool("QGLPixelBuffer::hasOpenGLPbuffers: ", QGLPixelBuffer::hasOpenGLPbuffers()); - d += printBool("QGLFramebufferObject::hasOpenGLFramebufferObjects: ", - QGLFramebufferObject::hasOpenGLFramebufferObjects()); - d += printBool("QGLFramebufferObject::hasOpenGLFramebufferBlit: ", - QGLFramebufferObject::hasOpenGLFramebufferBlit()); + d += printBool("QOpenGLFramebufferObject::hasOpenGLFramebufferObjects: ", + QOpenGLFramebufferObject::hasOpenGLFramebufferObjects()); + d += printBool("QOpenGLFramebufferObject::hasOpenGLFramebufferBlit: ", + QOpenGLFramebufferObject::hasOpenGLFramebufferBlit()); d += printBool("QGLShaderProgram::hasOpenGLShaderPrograms: ", QGLShaderProgram::hasOpenGLShaderPrograms()); return d; diff --git a/util/qt3d/qglinfo/qglinfo.pro b/util/qt3d/qglinfo/qglinfo.pro index f792bb6ea..f8e5d9a18 100644 --- a/util/qt3d/qglinfo/qglinfo.pro +++ b/util/qt3d/qglinfo/qglinfo.pro @@ -1,5 +1,5 @@ TARGET = qglinfo -QT += qt3d widgets +QT += qt3d SOURCES += main.cpp \ qglinfowindow.cpp \ diff --git a/util/qt3d/qt3d.pro b/util/qt3d/qt3d.pro index 73438b6c0..4d40584e6 100644 --- a/util/qt3d/qt3d.pro +++ b/util/qt3d/qt3d.pro @@ -1,2 +1,2 @@ TEMPLATE = subdirs -contains(QT_CONFIG, widgets): SUBDIRS += qglinfo +contains(QT_CONFIG, widgets): contains(QT_CONFIG, opengl): SUBDIRS += qglinfo |