summaryrefslogtreecommitdiffstats
path: root/examples/opengl/hellogl2/mainwindow.cpp
Commit message (Collapse)AuthorAgeFilesLines
* wasm: hellogl2 screen is blackEven Oscar Andersen2024-07-011-1/+2
| | | | | | | | | | | We need to reset the OpenGL state in paintGL for the drawing to work, Also, disable the dock/add window functionality as it does not work on webassembly. Change-Id: I480d944bc2029a07d5d49f0a85c3754fbc8cd53c Reviewed-by: Lorn Potter <[email protected]>
* hellogl2 example: Decouple mainwindow from windowFriedemann Kleint2023-09-181-1/+1
| | | | | | | | | | The circular dependency cannot be ported to the corresponding Python example. Task-number: PYSIDE-2206 Pick-to: 6.6 6.5 Change-Id: I031b3fffdd7bd677d2fc55e132975a65f66ad128 Reviewed-by: Laszlo Agocs <[email protected]>
* hellogl2 example: Streamline codeFriedemann Kleint2023-09-181-8/+8
| | | | | | | | | | | | | | - Shorten menu code, add keyboard shortcuts and a quit action. - Avoid calls to setLayout(). - Pass a parent to message boxes. - Use the current screen for size calculation and consider availableGeometry(). - Prevent closing by the Escape key in docked mode. - Split the dockUndock() function into dock()/undock() for clarity Pick-to: 6.6 6.5 Change-Id: I007da3bff86ee3f2dc8f87379e5d2ba2f0f6f3d7 Reviewed-by: Laszlo Agocs <[email protected]>
* Use SPDX license identifiersLucie Gérard2022-05-161-49/+2
| | | | | | | | | | | | | Replace the current license disclaimer in files by a SPDX-License-Identifier. Files that have to be modified by hand are modified. License files are organized under LICENSES directory. Task-number: QTBUG-67283 Change-Id: Id880c92784c40f3bbde861c0d93f58151c18b9f1 Reviewed-by: Qt CI Bot <[email protected]> Reviewed-by: Lars Knoll <[email protected]> Reviewed-by: Jörg Bornemann <[email protected]>
* Cleanup QtOpenGL examplesChristian Ehrlicher2019-09-301-1/+2
| | | | | | | | | | | 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 <[email protected]> Reviewed-by: Laszlo Agocs <[email protected]>
* Unify license header usage.Jani Heikkinen2016-03-291-3/+13
| | | | | | | | | Update files using old header.LGPL3 to header.LGPL Update files using old FDL template to use new one Update files using old BSD template to use new one Change-Id: I36a78272516f9953d02956522f285b40adfc8915 Reviewed-by: Lars Knoll <[email protected]>
* Updated Hello GL2 Example to new Signal/Slot syntaxBenjamin Summerton2015-06-291-1/+1
| | | | | | | | | The Hello GL2 Example was using the older Signal/Slot syntax that made use of the macros `SIGNAL()` and `SLOT()`. I changed it to the newer one. Change-Id: I8e55015383847a04b07f751fe9fc94b81956a896 Reviewed-by: Laszlo Agocs <[email protected]>
* Updated BSD licensed file headersJani Heikkinen2015-02-151-3/+3
| | | | | Change-Id: I6441ff931dbd33b698d762e6f6784898f3f60fe7 Reviewed-by: Oswald Buddenhagen <[email protected]>
* Update copyright headersJani Heikkinen2015-02-111-5/+5
| | | | | | | | | | | | | | | | | | Qt copyrights are now in The Qt Company, so we could update the source code headers accordingly. In the same go we should also fix the links to point to qt.io. Outdated header.LGPL removed (use header.LGPL21 instead) Old header.LGPL3 renamed to header.LGPL3-COMM to match actual licensing combination. New header.LGPL-COMM taken in the use file which were using old header.LGPL3 (src/plugins/platforms/android/extract.cpp) Added new header.LGPL3 containing Commercial + LGPLv3 + GPLv2 license combination Change-Id: I6f49b819a8a20cc4f88b794a8f6726d975e8ffbe Reviewed-by: Matti Paaso <[email protected]>
* Modernize the OpenGL examplesLaszlo Agocs2014-08-121-0/+66
Change them to use QOpenGLWidget and QOpenGLTexture. Advocate also the usage of VBOs. Hopeless examples, that rely on the fixed pipeline and will not compile or work in ES and dynamic builds, are moved to a "legacy" directory. The documentation pages for these are removed. This long due change avoids the confusion newcomers experience when trying to get started with Qt 5 and OpenGL. hellowindow's behavior is changed to open a single window only by default. The old default behavior, that opened three windows on platforms that supported both MultipleWindows & ThreadedOpenGL, can be requested by passing --multiple. --single is removed since it is the default now. This plays much nicer with drivers that have issues with threading. In addition, say hello to hellogl2. This is the old hellogl example updated to use QOpenGLWidget and OpenGL 2. It also has a mainwindow with multiple (un)dockable widgets containing the OpenGL widgets. This helps testing the behavior when the top-level of the QOpenGLWidget changes and provides a very important example of how to do proper resource management in this case. (must use aboutToBeDestroyed() of the context, since the context goes away and is replaced by a new one on every dock/undock) As a bonus, the logo is now real 3D, no more orthographic nonsense. Launch with --multisample to request 4x MSAA. Launch with --coreprofile to request 3.2 Core. In this particular example the shaders are present in both versions and there is a VAO so the application is functional with core profile contexts. Change-Id: Id780a80cb0708ef164cc172450ed74050f065596 Reviewed-by: Gunnar Sletta <[email protected]>