aboutsummaryrefslogtreecommitdiffstats
path: root/examples/quick/scenegraph
Commit message (Collapse)AuthorAgeFilesLines
* Fix custommaterial example with OpenGLLaszlo Agocs2021-02-193-1/+1
| | | | | | | | | | | | | | The member names in the "uniform block" (which is in practice mapped to a struct uniform with GLSL) must match between the vertex and fragment shaders, even if the member is not used in one of the shaders. This is because OpenGL/GLSL's interface matching rules, which would cause the shader program fail to link due to a mismatch in the structs in the two shaders. Change-Id: I9a928b4b20fdff14530c16a93a52967ce6c328a3 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> (cherry picked from commit 21d9cd844e5c572b03b73400c110adc6fc78ae75) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix building the d3d11underqml example with MinGWFriedemann Kleint2020-11-261-9/+9
| | | | | | | | | | | | Fix format mismatch qtdeclarative/examples/quick/scenegraph/d3d11underqml/d3d11squircle.cpp:369:16: error: format '%x' expects argument of type 'unsigned int', but argument 3 has type 'HRESULT' {aka 'long int'} [-Werror=format=] qFatal("Failed to create buffer: 0x%x", hr); by casting to uint (as is done in an existing qWarning()). Change-Id: I9bed3066936af8a1831b695a76d40989a834fde9 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io> (cherry picked from commit 203acb1955c889b51b760c3f1410558b524c53d2) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Doc: Fix documentation warnings for Qt QuickTopi Reinio2020-11-052-4/+2
| | | | | | | | | | | - Remove links to modules and examples that are not part of Qt 6. - Remove links to entities marked as \internal - Add missing enum value and QML property docs where it's trivial to do so. Task-number: QTBUG-88156 Change-Id: I10a1c7bcc5fe0e2354ea69eaf24930362edb7415 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* CMake: Regenerate examples to set the WIN32_EXECUTABLE propertyAlexandru Croitor2020-10-2614-0/+56
| | | | | | | | | As well as the MACOSX_BUNDLE properties as necessary. Task-number: QTBUG-87664 Task-number: QTBUG-86827 Change-Id: I46769fb543acb2cbeba122470b5e44ad478fbe4e Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* CMake: Regenerate examples to use qt_add_executableAlexandru Croitor2020-10-2014-14/+14
| | | | | | Task-number: QTBUG-87661 Change-Id: Ie5bba408000211b24694aa0143bdf79c4a298f42 Reviewed-by: Daniel Smith <Daniel.Smith@qt.io>
* Adapt to platform API renameTor Arne Vestbø2020-10-092-3/+3
| | | | | Change-Id: I1f2171e18ec3df71f7eaec1be0e0e0d1442a3860 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* examples: include QQuickWindow in squircle headersUlf Hermann2020-09-134-0/+4
| | | | | | | This is required because QQuickWindow is passed as a signal parameter. Change-Id: Ied10beded7253558d080af4806d1b95880bf2d98 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Make twotextureproviders example functional againLaszlo Agocs2020-09-074-0/+42
| | | | | Change-Id: I6a317fc8628b902e535a31daf4a3886fc87d08bc Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Regenerate graph example shadersLaszlo Agocs2020-09-074-0/+0
| | | | | Change-Id: Id4fe4d0e177180fadd10f34b9ebad17c71e40314 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Add CMake project file for custommaterial exampleLaszlo Agocs2020-09-074-6/+126
| | | | | | | | | The name conflicts with a Quick3D example so try to use the same approach as it was done for customgeometry. Task-number: QTBUG-86205 Change-Id: Ie01cd6c0118d512b2f45d4c6e782ec6639e052c6 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Remove old GLSL code from fboitem exampleLaszlo Agocs2020-09-077-34/+18
| | | | | | | There is no OpenGL path anymore in Qt 6, no point using file selectors. Change-Id: I4b7afbbb193dfe1a6e912a909babab0aeb8dcdda Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Remove use of deprecated High-DPI application attributesTor Arne Vestbø2020-09-021-1/+0
| | | | | Change-Id: Ibfb50fdcbb51ba93d6e5d11f9e8ce0e7b3bfde79 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* Doc: Capitalize "GUI" correctlySze Howe Koh2020-08-301-1/+1
| | | | | | Pick-to: 5.15 Change-Id: I2230e2dcb7bc2497b5dbe71a22c21d84176b5e57 Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch>
* CMake: Rename example conflicting with qtquick3dAlexandru Croitor2020-08-252-7/+63
| | | | | | Fixes: QTBUG-86205 Change-Id: I38992501abb86a4328527283ad8924ec886ea8c8 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Switch to MTLTexture protocol in QSGTexture native accessLaszlo Agocs2020-08-041-1/+1
| | | | | | | Now only available from ObjC code. Change-Id: I88df6c8839fc660ffd2b8e88a789ca73a9d4accd Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Add type safe native texture accessorsLaszlo Agocs2020-08-032-8/+6
| | | | | | | | Following the pattern from QtGui. Task-number: QTBUG-85239 Change-Id: I07b4456028d0f45223ad10e55ce65f423bab6a9b Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Use QList instead of QVectorJarek Kobus2020-06-251-3/+3
| | | | | | Task-number: QTBUG-84469 Change-Id: I4c3353c00a566023503fbc178ba8454391dc334c Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* New custom material examplePaul Olav Tvete2020-06-2413-3/+749
| | | | | | Fixes: QTBUG-78577 Change-Id: I280ffeda4bba1a9c170feb1ffa4b6c95eb0e6d28 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Rename setSceneGraphBackend to setGraphicsApiLaszlo Agocs2020-06-227-7/+7
| | | | | | | | | | | | | | | | ...and fix up the docs. The string-based setSceneGraphBackend() stays of course (the docs have been enhanced, however). The GraphicsApi enum-based overload is now renamed to setGraphicsApi(). Using the same name for both functions is a historical artifact, reflecting the evolution (5.0 - 5.8 - 5.14). In 6.0 we can give it a more appropriate name, since it does not have much to do with "backends" from the user's perspective. Change-Id: Id75dbf81f50a148797e5b5de9be4000153737473 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Fix GL_ constant usage in examplesLaszlo Agocs2020-06-174-6/+6
| | | | | Change-Id: Iecfa47845edb78928b388d150a3229f8c7a93d5d Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* Anisotropic antialiasing for distance field textEskil Abrahamsen Blomfeldt2020-06-153-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For perspective transforms, we need to find the sample range in the glyph cache per pixel. We can do this by getting the gradient of the distance field at the specific pixel. This will ensure proper antialiasing with any projection, but has the limitation that when glyph contours become thinner than a pixel, they may disappear or become too emphasized, because the hardware-gradient - based on neighbouring fragments - is not reliable at that scale. So we should only default to this when we detect that the text is child of a 3D scene. To make this smooth, we need to know the mode of the renderer when creating the shader. So QSGMaterial::createShader() now takes a render mode that we can use to customize behavior based on whether it is rendering into a 2D or 3D scene. [ChangeLog][QtQuick] The QSGMaterial::createShader() virtual function has been extended to take a render mode argument, which can be used for any customizations needed in the case where the shader will be used in combination with 3D perspective transformations. Fixes: QTBUG-84695 Change-Id: I5a18a4edbdfa07e8f9d506c42bb20e8eb580927d Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* fboitem example: Request OpenGL explicitlyLaszlo Agocs2020-06-121-0/+2
| | | | | | | It wouldn't render otherwise. Change-Id: I185459f2eccdffac4f7d7968e48aab4141e0908c Reviewed-by: Christian Strømme <christian.stromme@qt.io>
* openglunderqml example: remove unnecessary resetOpenGLState callLaszlo Agocs2020-06-112-4/+2
| | | | | | | | | | | | | | | Also request the OpenGL RHI backend explicitly, like all the other similar examples (d3d11underqml, and so on) do. Calling resetOpenGLState() in this example is pointless because it happens before returning from the custom rendering function, and the endExternalCommands() call achieves the same internally, i.e. the rhi will know that cached state cannot be used anymore. There are other valid uses cases for resetOpenGLState() but this example does not have those. Change-Id: Ifa7861b80c29c174d02cfe37fe8ef8eed7344195 Reviewed-by: Christian Strømme <christian.stromme@qt.io>
* Remove rendernode and opengltextureinthread examplesJonas Karlsson2020-06-1030-2526/+0
| | | | | | Task-Id: QTBUG-84623 Change-Id: I786a7a8ee256d8c395dd0e828213c5d137ba20dc Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Enable Metal-based scenegraph examplesLaszlo Agocs2020-06-101-3/+3
| | | | | Change-Id: Ib2734fb10feaac106bb6483a8a361c7b35af3348 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Make QSGMaterialRhiShader become QSGMaterialShaderLaszlo Agocs2020-06-023-9/+3
| | | | | | | | | | | | | | | | After a symbiotic relationship in Qt 5.14 and 5.15, it is time for QSGMaterialRhiShader to devour its older sibling and take its place. This makes the direct OpenGL rendering path disfunctional. All QSGMaterial Qt 6 TODOs are solved, the API is clean and straightforward again: a QSGMaterial creates a QSGMaterialShader, no special flags and options needed. (it's just that QSGMaterialShader now has a slightly different API) Task-number: QTBUG-79268 Task-number: QTBUG-82997 Change-Id: I545ca8d796c5535e81957c706e7832133be15b7d Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* CMake: Don't install .qmltypes for Qt tests, examples and toolsAlexandru Croitor2020-05-2913-13/+0
| | | | | | | | | | | that don't have an explicit QT_QML_MODULE_INSTALL_DIR path specified. We don't want to pollute the Qt qml import path with these files. Task-number: QTBUG-84403 Change-Id: I768267e0e79daa8090d882c301648cce14e1a809 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* CMake: Regenerate qtdeclarative/examplesAlexandru Croitor2020-05-2911-11/+55
| | | | | | | | | Includes - new example installation paths - one case of QT_QMLTYPES_FILENAME addition Change-Id: I24423da9b04b6ecc8445017fa35f148dd43b1829 Reviewed-by: Cristian Adam <cristian.adam@qt.io>
* Avoid truncating in QSGMaterial::compare() implementationsLaszlo Agocs2020-05-272-10/+7
| | | | | | | | | | | | The Qt 5.0 pattern of subtracting pointers and returning them is not suitable (on 64-bit archs) since the return type is an int. There is also QSGTexture::comparisonKey() now which is a qint64. Just return -1 and 1 as appropriate. Change-Id: Iaf3377b484a8c4b19b0960f1e8def05e4fa68ce7 Reviewed-by: Christian Strømme <christian.stromme@qt.io>
* Adjust QSGTexture comparisonKey typeLaszlo Agocs2020-05-272-3/+3
| | | | | | | | | | | | | | | | | | | | | The original choice was int, simply following textureId(). This was later deemed insufficient: instead of a GLuint, the value is now often a 64-bit value (on 64 bit systems), based on a pointer, since the identity of a texture in the RHI world is the QRhiTexture* itself. In a custom texture implementation it is likely that the value here is the value of a native object handle, either a pointer or some 32 or 64 bit integer. Inspired by the recent QSGTexture::NativeTexture struct change (void* -> quint64), switch to a qint64 which is big enough to hold all these without truncation. We choose a signed value here, in order to allow for the following pattern that is widespread in material compare() implementations: if (qint64 diff = m_texture->comparisonKey() - other->texture()->comparisonKey()) return diff; Fixes: QTBUG-83769 Change-Id: I8bdae8cd835282358ded53b3703142b8f26e4400 Reviewed-by: Christian Strømme <christian.stromme@qt.io>
* Adapt to changes in NativeTexture in qtbaseEskil Abrahamsen Blomfeldt2020-05-253-4/+4
| | | | | | | | | | To make the API less error prone, we have changed the void pointer to the texture handle to a 64-bit in instead, since all handles are maximum 64-bit. Task-number: QTBUG-78638 Change-Id: I9d995d6a883b3377f57d7c5b19d4bc4e15aa347b Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Add missing CMake project for vulkantextureimportLaszlo Agocs2020-05-252-1/+63
| | | | | | | | ...and enable vulkanunderqml and vulkantextureimport in the CMakeLists one level up. Change-Id: I91d659e028b0e7f53b5860bbfbdbb98c18e333c7 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Fix up the scenegraph/textureinthread exampleLaszlo Agocs2020-05-1813-48/+28
| | | | | | | | | | | | | Force OpenGL, remove the ShaderEffect (it serves no purpose in this example) and remove deprecated API usage. Finally, rename the example to opengltextureinthread. Note that the example's performance is sub-par, but the same is true with direct OpenGL. Change-Id: I7eaa2349ffdb3d27bd9e8815d674e918bc709c03 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* Remove leftover legacy shader files in scenegraph exampleLaszlo Agocs2020-04-2913-102/+54
| | | | | | Task-number: QTBUG-82997 Change-Id: Icc328394154d7b352c9f47184c2f906d5afa4d44 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* QQuickItem: rename geometryChanged to geometryChangeMitch Curtis2020-04-236-9/+9
| | | | | | | | | | | | | | | | | | This brings it in line with the existing convention in this and other modules, where virtual handlers are named "nounChange"; e.g. itemChange. Signals are named "nounChanged". This also allows adding a geometryChanged signal, which would enable users to listen to one signal for all changes to x/y/width/height. [ChangeLog][QQuickItem] Renamed geometryChanged to geometryChange in order to follow existing naming conventions and have consistency with existing API, such as itemChange. Task-number: QTBUG-82994 Change-Id: I0547358c796a0047982ccfbf2c38bab952e7a634 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Merge remote-tracking branch 'origin/5.15' into devQt Forward Merge Bot2020-04-091-0/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/qml/jsruntime/qv4executablecompilationunit.cpp src/qml/jsruntime/qv4executablecompilationunit_p.h src/qml/qml/qqmlobjectcreator.cpp src/qml/qml/qqmlpropertycachecreator_p.h src/qml/qml/qqmltypecompiler.cpp src/qml/qml/qqmltypedata.cpp tests/auto/qml/qmlformat/tst_qmlformat.cpp tools/qmllint/scopetree.cpp src/qml/qml/qqmlapplicationengine_p.h Adjusted tools/qmllint/findunqualified.cpp to use newer API Change-Id: Ibfb4678ca39d626d47527265e3c96e43313873d4
| * Add missing include to d3d11underqml exampleLaszlo Agocs2020-04-071-0/+1
| | | | | | | | | | | | Change-Id: Ib1891a509dccdbe071ce71058aaa58887ddfeb8e Reviewed-by: Jonas Karlsson <jonas.karlsson@qt.io> Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* | twotextureproviders example: rip out legacy OpenGL material implLaszlo Agocs2020-04-072-64/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | Leave only the RHI version in. Also add a temporary forcing of the RHI rendering path for now. This will go away when purging the direct OpenGL path in Qt Quick because RHI will be the default anyhow. Now both graph and twotextureproviders follow the same structure and approach, and together serve as a fairly good examples of creating custom materials in the RHI world. Change-Id: I4aafd440f70d13b8033fd4fdf0ecce71798c68d2 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* | Update graph example CMakeLaszlo Agocs2020-04-072-9/+5
| | | | | | | | | | | | | | | | Also update OTHER_FILES in the .pro although that's not strictly required for building. Change-Id: Ib48e64b298c1a7b1600ecd1f13580398679b72a2 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* | Remove QSGSimpleMaterialLaszlo Agocs2020-04-0728-1013/+312
| | | | | | | | | | | | | | | | | | | | And port the graph example to QSGMaterial and the RHI. We will not anymore add a direct OpenGL path (that would mean using QSGMaterialShader) for the example because the upcoming purge renders that useless anyway. Task-number: QTBUG-82988 Change-Id: I137575ed5df45b6bfc34a11d73dc5100945081c5 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* | Remove sgengine from scenegraph examples CMake project fileLaszlo Agocs2020-04-071-1/+0
| | | | | | | | | | Change-Id: Ifb2f986ec9d4fd0bfdd35f2e59d7d1d916ac2098 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* | Remove QSGEngine and move QSGAbstractRenderer back to privateLaszlo Agocs2020-04-078-544/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QSGEngine goes away. Same for the associated example, which is the only place this is used anywhere in Qt. As a consequence, the renderer base class can be moved back to private: there is no use for it to be public anymore, since that made sense only in combination with QSGEngine. With the RHI-based rendering path driving a renderer directly is more complicated than before so it is not reasonable to allow the QSGEngine-style access anymore. Instead, one has QQuickRenderControl, which allows redirecting and manually driving the rendering of a QQuickWindow, thus providing an alternative to the legacy QSGEngine approach. Task-number: QTBUG-78596 Change-Id: If57c6b657b2053da1c4e545e517026382a71d998 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* | CMake: Update Apple platform defines after rename in qtbaseTor Arne Vestbø2020-03-175-5/+5
| | | | | | | | | | Change-Id: Ia0a075e3199eab735f9b289873beeb8730ebc47e Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Update dependencies.yaml to latest SHA1sEskil Abrahamsen Blomfeldt2020-03-133-0/+3
| | | | | | | | | | | | | | | | Required three updates to examples due to some changes in the dependency graph. Change-Id: I48dc9bf6d4fa82395bdf25deb1a768c354097bdc Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* | Merge remote-tracking branch 'origin/wip/cmake' into devAlexandru Croitor2020-03-1216-0/+940
|\ \ | | | | | | | | | | | | | | | | | | Conflicts: dependencies.yaml Change-Id: Ifff48b9d0e7962d481e63c49399e2d304e1011e5
| * | CMake: Regenerate and adapt to merge from devwip/cmakeAlexandru Croitor2020-03-123-2/+18
| | | | | | | | | | | | | | | | | | Change-Id: If8daa6152a563d4309d7342414780ef75b9f5589 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Leander Beernaert <leander.beernaert@qt.io>
| * | Merge remote-tracking branch 'origin/dev' into wip/cmakeAlexandru Croitor2020-03-1214-15/+18
| |\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: dependencies.yaml src/qml/qml/qqmlengine.cpp Change-Id: I6a73fd1064286f4a2232de85c2ce7f80452d4641
| * | | Regenerate qtdeclarativeAlexandru Croitor2020-02-121-5/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Change-Id: I48d7fd306f3d1b161a8e73029282ee591b1ef612 Reviewed-by: Leander Beernaert <leander.beernaert@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Liang Qi <liang.qi@qt.io>
| * | | Merge remote-tracking branch 'origin/dev' into wip/cmakeAlexandru Croitor2020-01-295-9/+9
| |\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: dependencies.yaml Change-Id: Ie3e9dc62031a85e5e81cbdf04694b95159d49fca
| * | | | Regenerate examplesAlexandru Croitor2020-01-2911-0/+88
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change-Id: I39564d4b644a7ee367d9ce92b85426a5c2a122a4 Reviewed-by: Leander Beernaert <leander.beernaert@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>