summaryrefslogtreecommitdiffstats
path: root/examples/opengl
Commit message (Collapse)AuthorAgeFilesLines
* CMake: Regenerate examples to set the WIN32_EXECUTABLE propertyAlexandru Croitor2020-10-2713-0/+52
| | | | | | | | | As well as the MACOSX_BUNDLE properties as necessary. Task-number: QTBUG-87664 Task-number: QTBUG-86827 Change-Id: I7677449a26d51fa853bd67bab6b3b61afbd2b12f Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* CMake: Regenerate examples to use qt_add_executableAlexandru Croitor2020-10-1913-13/+13
| | | | | | Task-number: QTBUG-87661 Change-Id: I0dacfdc97a3fb7d88da85b67800f2c1b084d869b Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Get rid of all usage of QApplication:desktopVolker Hilsheimer2020-10-142-4/+5
| | | | | | | | Use QScreen APIs instead. Change-Id: Ie99af94fe4292223dbb165b3f5c1b74e8fe0498b Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Rename the new platform APIs from QPlatformInterface to QNativeInterfaceTor Arne Vestbø2020-10-071-1/+1
| | | | | | | | | | | | We were already using the 'native' nomenclature when referring to these kinds of APIs, e.g. when talking about native handles, or the existing QPlatformNativeInterface on a QPA level. Using 'native' for the user facing APIs also distinguishes them from the 'platform' backend layer in QPA and elsewhere. Change-Id: I0f3273265904f0f19c0b6d62471f8820d3c3232e Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Switch QSurfaceFormat::colorSpace to a QColorSpaceAllan Sandfeld Jensen2020-09-151-1/+2
| | | | | | | Allows more flexibility in the future. Change-Id: Idcf2d8ddaee268a7b5d55379ccb42dd9b3c33abf Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Doc: Move example file that was left behindPaul Wicking2020-09-101-0/+158
| | | | | | | | | | The qdoc-file that contains the example documentation was left behind when the OpenGL code moved from QtGui to QtOpenGL. This causes all the snippet commands to fail. Task-number: QTBUG-74409 Change-Id: I86a753d4fc832965e76a085062882e6c720becd2 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* CMake: Regenerate examplesAlexandru Croitor2020-07-0913-13/+65
| | | | | | Change-Id: I1c51b10af4e2b26f54740f257164c56a0e2a03ce Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Introduce platform API abstraction for QOpenGLContextTor Arne Vestbø2020-07-021-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The API is available by including qopenglcontext.h as usual, but scoped in the QPlatformInterface namespace. The namespace exposes platform specific type-safe interfaces that provide: a) Factory functions for adopting native contexts, e.g. QCocoaGLContext::fromNative(nsContext, shareContext); b) Access to underlying native handles, e.g. openGLContext->platformInterface<QCocoaGLContext>->nativeContext() c) Platform specific functionality, e.g. static QWGLContext::openGLModuleHandle() openGLContext->platformInterface<QEGLContext>->doSomething(); The platform interfaces live close to the classes they extend, removing the need for complex indirection and plumbing, and avoids kitchen-sink modules and APIs such as the extras modules, QPlatformFunctions, or QPlatformNativeInterface. In the case of QOpenGLContext these platform APIs are backed by the platform plugin, so dynamic_cast is used to ensure the platform plugin supports the requested interface, but this is and implementation detail. The interface APIs are agnostic to where the implementation lives, while still being available to the user as part of the APIs they extend/augment. The documentation will be restored when the dust settles. Task-number: QTBUG-80233 Change-Id: Iac612403383991c4b24064332542a6e4bcbb3293 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Use QList instead of QVector in examplesJarek Kobus2020-06-237-13/+13
| | | | | | Task-number: QTBUG-84469 Change-Id: Id14119168bb1bf11f99bda7ef6ee9cf51bcfab2e Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
* Phase 2 of removing QDesktopWidgetVolker Hilsheimer2020-06-082-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | Remove QDestopWidget public header, simplify the implementation that maintains a Qt::Desktop type QWidget for each QScreen, and turn QWidget's initial target screen into a QScreen pointer. QApplication::desktop() now takes an optional QScreen pointer, and returns a QWidget pointer, so that applications and widgets can get access to the root widget for a specific screen without having to resort to private APIs. QDesktopWidgetPrivate implementations to look up a screen for an index, widget, or point are now all inline functions that thinly wrap QGuiApplication::screens/screenAt calls. We should consider adding those as convenience APIs to QScreen instead. Note that QWidget::screen is assumed to return a valid pointer; there is code that handles the case that it returns nullptr (but also code that trusts that it never is nullptr), so this needs to be defined, verified with tests, and asserted. We can then simplify the code further. Change-Id: Ifc89be65a0dce265b6729feaf54121c35137cb94 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Replace calls to deprecated QEvent accessor functionsShawn Rutledge2020-06-083-10/+10
| | | | | | | Many of these were generated by clazy using the new qevent-accessors check. Change-Id: Ie17af17f50fdc9f47d7859d267c14568cc350fd0 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Fix hellowindow exampleMichal Klocek2020-05-252-59/+30
| | | | | | | | | | | | | | | | | | | | It seems this example never worked as expected. It has a 'multiple' option which should show extra windows with rendering taking place in different thread, however although render is moved to other thread render() function was never called in that thread. Fix following things: * make rendering in other thread * stop requestUpdate if nothing is exposed * add timer so animation works at the same speed despite of number of windows (renderer B renders two windows) * wait for render to finish before triggering requestUdpate * remove mutex where not needed Pick-to: 5.15 Change-Id: I420436bd28d0357534332dd55b088d634d906c14 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Merge remote-tracking branch 'origin/5.15' into devQt Forward Merge Bot2020-04-081-1/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: examples/opengl/doc/src/cube.qdoc src/corelib/global/qlibraryinfo.cpp src/corelib/text/qbytearray_p.h src/corelib/text/qlocale_data_p.h src/corelib/time/qhijricalendar_data_p.h src/corelib/time/qjalalicalendar_data_p.h src/corelib/time/qromancalendar_data_p.h src/network/ssl/qsslcertificate.h src/widgets/doc/src/graphicsview.qdoc src/widgets/widgets/qcombobox.cpp src/widgets/widgets/qcombobox.h tests/auto/corelib/tools/qscopeguard/tst_qscopeguard.cpp tests/auto/widgets/widgets/qcombobox/tst_qcombobox.cpp tests/benchmarks/corelib/io/qdiriterator/qdiriterator.pro tests/manual/diaglib/debugproxystyle.cpp tests/manual/diaglib/qwidgetdump.cpp tests/manual/diaglib/qwindowdump.cpp tests/manual/diaglib/textdump.cpp util/locale_database/cldr2qlocalexml.py util/locale_database/qlocalexml.py util/locale_database/qlocalexml2cpp.py Resolution of util/locale_database/ are based on: https://codereview.qt-project.org/c/qt/qtbase/+/294250 and src/corelib/{text,time}/*_data_p.h were then regenerated by running those scripts. Updated CMakeLists.txt in each of tests/auto/corelib/serialization/qcborstreamreader/ tests/auto/corelib/serialization/qcborvalue/ tests/auto/gui/kernel/ and generated new ones in each of tests/auto/gui/kernel/qaddpostroutine/ tests/auto/gui/kernel/qhighdpiscaling/ tests/libfuzzer/corelib/text/qregularexpression/optimize/ tests/libfuzzer/gui/painting/qcolorspace/fromiccprofile/ tests/libfuzzer/gui/text/qtextdocument/sethtml/ tests/libfuzzer/gui/text/qtextdocument/setmarkdown/ tests/libfuzzer/gui/text/qtextlayout/beginlayout/ by running util/cmake/pro2cmake.py on their changed .pro files. Changed target name in tests/auto/gui/kernel/qaction/qaction.pro tests/auto/gui/kernel/qaction/qactiongroup.pro tests/auto/gui/kernel/qshortcut/qshortcut.pro to ensure unique target names for CMake Changed tst_QComboBox::currentIndex to not test the currentIndexChanged(QString), as that one does not exist in Qt 6 anymore. Change-Id: I9a85705484855ae1dc874a81f49d27a50b0dcff7
| * Doc: replace deprecated references to QGLWidgetChristian Ehrlicher2020-03-202-12/+12
| | | | | | | | | | | | | | | | Remove references to the deprecated QGLWidget and replace it with QOpenGLWidget. Change-Id: Ia31df42ab61c25e9ce46f4491267d2c64910f55c Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* | Merge remote-tracking branch 'origin/5.15' into devQt Forward Merge Bot2020-03-112-0/+2
|\| | | | | | | Change-Id: Ibee5acec72a1a1769d4bc5f23f56c7dc8d4cf3cb
| * Add default arguments to QPainterPath methods using transformJarek Kobus2020-03-062-0/+2
| | | | | | | | | | | | | | Fixes: QTBUG-82602 Change-Id: Id82f145ffb33e6d4ef9b81282ad14657b1c8fbd0 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | Remove legacy OpenGL examplesJohan Klokkhammer Helsing2020-02-2156-5290/+0
| | | | | | | | | | | | | | | | They all used QGL (which has been removed). Task-number: QTBUG-74408 Change-Id: Ied003625f14228b4951002a604fce91eaccec102 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* | Move QOpenGLShaderProgram from QtGui to QtOpenGLJohan Klokkhammer Helsing2020-02-207-5/+9
| | | | | | | | | | | | Task-number: QTBUG-74409 Change-Id: I20dfafc0c9bf8e2b68b03e171d70c2cb4ad2bfaf Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* | Docs: Remove traces of QGLJohan Klokkhammer Helsing2020-02-202-20/+17
| | | | | | | | | | | | | | | | | | The QGL* classes have been removed and the examples ported to QOpenGL, update the documentation to reflect that. Task-number: QTBUG-74408 Change-Id: Ibb4787cdeedc05a807d673943b61838f19092234 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* | Move QOpenGLWidget from QtOpenGL to its own moduleJohan Klokkhammer Helsing2020-02-1812-6/+18
| | | | | | | | | | | | | | | | Same pattern as QtQuickWidgets. Gets rid of QtOpenGL's dependency on QtWidgets. Task-number: QTBUG-74409 Change-Id: I4f9b55c23e25a1e0519734037b768a16e870c7d2 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* | Move QOpenGLFrameBufferObject from QtGui to QtOpenGLJohan Klokkhammer Helsing2020-02-171-1/+1
| | | | | | | | | | | | Task-number: QTBUG-74409 Change-Id: I817ea6f052fc61a6465d443450c8017ac5d0c0e9 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* | Regenerate projects one last time before mergewip/cmakeAlexandru Croitor2020-02-121-5/+2
| | | | | | | | | | | | Change-Id: Ia24cf56b79ca6dacd370a7e397024e9b663e0167 Reviewed-by: Liang Qi <liang.qi@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | QSpinBox: remove deprecated signal valueChanged(const QString &)Vitaly Fanaskov2020-02-101-1/+1
| | | | | | | | | | | | Task-number: QTBUG-81845 Change-Id: I91148cac553f63b44968337ccc121e7376ee4465 Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
* | Post-merge fixesAlexandru Croitor2020-01-304-0/+75
| | | | | | | | | | Change-Id: I6acd29103f6cc550544e7422328d97ea0e2dcafb Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Merge remote-tracking branch 'origin/dev' into wip/cmakeAlexandru Croitor2020-01-297-0/+443
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/Qt5CoreConfigExtras.cmake.in src/corelib/Qt5CoreMacros.cmake src/dbus/Qt5DBusConfigExtras.cmake.in src/widgets/Qt5WidgetsConfigExtras.cmake.in Change-Id: Ib782f3b177c38b2cce83beebe15be9c0baa578f7
| * | Move QOpenGLPaintEngine and related classes from QtGui to QtOpenGLJohan Klokkhammer Helsing2020-01-227-0/+443
| | | | | | | | | | | | | | | | | | | | | | | | | | | Also moves the openglwindow test to the opengl folder, as it makes use of these classes. Task-number: QTBUG-74409 Change-Id: Id9f0013cedcc8bd1e87122c005641d7298525045 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* | | Post Merge FixesLeander Beernaert2020-01-2419-28/+50
| | | | | | | | | | | | | | | Change-Id: I1e06c01b76b119c3f23b6e6ecbaae8df719b70ce Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* | | Merge remote-tracking branch 'origin/dev' into merge-devLeander Beernaert2020-01-2410-9/+14
|\| | | | | | | | | | | Change-Id: I31b761cfd5ea01373c60d02a5da8c33398d34739
| * | Move QOpenGLWindow from QtGui to QtOpenGLJohan Klokkhammer Helsing2020-01-153-0/+5
| | | | | | | | | | | | | | | | | | Task-number: QTBUG-74409 Change-Id: If7d27cdfa2c6cd5b167887ad77b9cfe413cb106a Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
| * | Move QOpenGLWidget from QtWidgets to QtOpenGLJohan Klokkhammer Helsing2019-12-126-6/+6
| |/ | | | | | | | | | | Task-number: QTBUG-74409 Change-Id: I98a4f8a9e1d439bfdc24eb2910385273cedecd29 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
| * Merge remote-tracking branch 'origin/5.14' into 5.15Qt Forward Merge Bot2019-11-081-3/+3
| |\ | | | | | | | | | Change-Id: I963b5f48b5d6f3500ca379fbd7f1a4290b570175
| | * Merge remote-tracking branch 'origin/5.13' into 5.14Qt Forward Merge Bot2019-11-061-3/+3
| | |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: .qmake.conf mkspecs/features/mac/default_post.prf src/corelib/tools/qsimd_p.h src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm util/qfloat16-tables/gen_qfloat16_tables.cpp Change-Id: If48fa8a3bc3c983706b609a6d3822cb67c1352a4
| | | * Fix computegles31 example crashing on Pi4Paolo Angelelli2019-10-291-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Due to work group size configured for desktop GL. Change-Id: Id62cf297e280e04aecba748cf41b62c64ed9a0b2 Done-with: Andrey Yaromenok <ayaromenok@gmail.com> Fixes: QTBUG-79374 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* | | | Merge remote-tracking branch 'origin/dev' into wip/cmakeSimon Hausmann2019-10-171-2/+2
|\| | | | | | | | | | | | | | | Change-Id: Ia1da879a7bd8f71a649661a1844144dd67d60b3a
| * | | Merge remote-tracking branch 'origin/5.14' into 5.15Qt Forward Merge Bot2019-10-161-2/+2
| |\| | | | | | | | | | | | | | Change-Id: Ifd83db69416230175ddc3161f640b612755018fc
| | * | Prepare for deprecating the QDesktopWidgetSona Kurazyan2019-10-151-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QDesktopWidget is marked as obsolete in docs, but it is not yet completely deprecated, some of its methods are still in use. Replace uses of the following methods marked as obsolete: - QDesktopWidget::screenNumber(QWidget*) -> QWidget::screen() - QDesktopWidget::screenGeometry(QWidget*) -> QWidget::screen()->geometry() - QDesktopWidget::availableGeometry(QWidget*) -> QWidget::screen()->availableGeometry() Task-number: QTBUG-76491 Change-Id: I2cca30f2b4caa6e6848e8190e09f959d2c272f33 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* | | | Merge remote-tracking branch 'origin/dev' into wip/cmakeAlexandru Croitor2019-10-1423-193/+111
|\| | | | | | | | | | | | | | | Change-Id: I4a78428a8ea273b6960792e3b8043f816fa37fcf
| * | | Cleanup QtOpenGL examplesChristian Ehrlicher2019-09-3023-193/+111
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Cleanup the OpenGL examples - use nullptr (clang-tidy) - use member-initialization - avoid redundant checks for != nullptr when deleting a pointer Change-Id: I3e4702690ed79e71c3e952d51ceef83b907b45b7 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* / / cmake: add examples/openglFrederik Gladhorn2019-10-0721-0/+809
|/ / | | | | | | | | | | | | Fixes: QTBUG-78164 Change-Id: Iccc8bb1354d2362c950de17a6c00e00f95272967 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Qt CMake Build Bot
* | QOpenGLWindow example: use std::unique_ptr instead of QScopedPointerMarc Mutz2019-07-252-8/+14
| | | | | | | | | | | | | | | | | | | | | | | | QScopedPointer is scheduled for deprecation, and can't decide whether it wants to be a scoped, or a unique pointer. The use of a unique_ptr members requires that the destructor be out-of-line, since the payload classes are only forward-declared in the header file. Change-Id: Id0dcdde52cb3adc30d3051d2eed1d24c76154921 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* | Remove usages of deprecated APIs of qtbase/guiSona Kurazyan2019-07-132-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Replaced the usages of deprecated APIs by corresponding alternatives in the library code and documentation. - Modified the tests to make them build when deprecated APIs disabled: * Made the the parts of the tests testing the deprecated APIs to be compiled conditionally, only when the corresponding methods are enabled. * If the test-case tests only the deprecated API, but not the corresponding replacement, added tests for the replacement. Change-Id: Ic38245015377fc0c8127eb5458c184ffd4b450f1 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* | Convert uses of QTime as a timer to QElapsedTimerEdward Welbourne2019-06-141-2/+2
| | | | | | | | | | | | | | | | Change-Id: I2297f61efa5adf9ea5194c7f3ff68574cbcf452c Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* | ThreadedOpenGL example: use std::unique_ptr instead of QScopedPointerMarc Mutz2019-05-151-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There's talk that QScopedPointer may be deprecated. Don't use it in examples anymore. Change-Id: I05a486c2a86fcc7015a9c21ed0ce9682b0c24034 Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* | examples: port away from Java-style iteratorsMarc Mutz2019-05-232-10/+3
| | | | | | | | | | | | | | | | | | | | | | There's no reason to use them here, the Mutable is misleading in a few instances, ranged-for is much simpler, and more future-proof. Change-Id: Ifd5eaae95bbaa0b4cf0f435e6cfee6d778817b44 Reviewed-by: David Faure <david.faure@kdab.com>
* | Merge remote-tracking branch 'origin/5.13' into devLiang Qi2019-05-151-3/+3
|\| | | | | | | | | | | | | | | | | Conflicts: src/corelib/global/qfloat16.cpp src/corelib/global/qfloat16.h src/plugins/platforms/windows/qwindowswindow.cpp Change-Id: I0938aaa6a9771f55e48c95ed29f6f5291431b947
| * Merge remote-tracking branch 'origin/5.12' into 5.13Qt Forward Merge Bot2019-05-121-3/+3
| |\ | | | | | | | | | Change-Id: I0c00ffe0eabebc919f22d6faa4bf958b288e8fd9
| | * hellogles3: Request core profile contextLaszlo Agocs2019-05-111-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ...instead of compatibility, in order to play nice with systems that have no compatibility profile support (macOS). Instancing needs OpenGL 3.x so sticking with 2.x contexts is not an option. The example looks fully compatible with core profile so its functionality should not change. Change-Id: If0d554a6208973aa8a4fb86757e246d170cd0e71 Fixes: QTBUG-75680 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* | | Deprecate conversion functions between QList and QSetLars Knoll2019-05-071-1/+1
|/ / | | | | | | | | | | | | | | | | | | Users should use range constructors instead to do the conversion. Keep conversion methods between QList and QVector as these will turn into a no-op in Qt 6, whereas forcing people to use range constructors would lead to deep copies of the data. Change-Id: Id9fc9e4d007044e019826da523e8418857c91283 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* / Examples: cleanup foreach usageChristian Ehrlicher2019-02-024-6/+6
|/ | | | | | | Replace deprecated foreach macro with range-based for loop Change-Id: If919ba1d1d4acddfc1c5460ce7aebf8c49e3ac38 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Use requestUpdate instead of timer in a few GL examplesTor Arne Vestbø2019-01-224-10/+24
| | | | | Change-Id: I235ad367fe693c86ef5a0844fde0573371b284db Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>