qt5base-lts/examples/opengl
Sean Harmer 51d40d7e9b Make gui/math3d classes use float rather than qreal
This corrects the mismatch between using floats for internal storage
and qreal in the API of QVector*D which leads to lots of implicit
casts between double and float.

This change also stops users from being surprised by the loss of
precision when using these classes on desktop platforms and removes
the need for the private constructors taking a dummy int as the final
argument.

The QMatrix4x4 and QQuaternion classes have been changed to use float
for their internal storage since these are meant to be used in
conjunction with the QVector*D classes. This is to prevent unexpected
loss of precision and to improve performance.

The on-disk format has also been changed from double to float thereby
reducing the storage required when streaming vectors and matrices. This
is potentially a large saving when working with complex 3D meshes etc.

This also has a significant performance improvement when passing
matrices to QOpenGLShaderProgram (and QGLShaderProgram) as we no
longer have to iterate and convert the data to floats. This is
an operation that could easily be needed many times per frame.

This change also opens the door for further optimisations of these
classes to be implemented by using SIMD intrinsics.

This needs to be applied in conjunction with

https://codereview.qt-project.org/#change,33548

Task-number: QTBUG-21035
Task-number: QTBUG-20661
Change-Id: I9321b06040ffb93ae1cbd72fd2013267ac901b2e
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-09-07 13:27:38 +02:00
..
2dpainting Remove "All rights reserved" line from license headers. 2012-01-30 03:54:59 +01:00
cube qtbase: Add missing example installs and files. 2012-07-10 22:24:40 +02:00
framebufferobject Squashed commit of changes from the 4.8-temp branch. 2011-05-23 14:24:07 +02:00
framebufferobject2 Remove "All rights reserved" line from license headers. 2012-01-30 03:54:59 +01:00
grabber Remove "All rights reserved" line from license headers. 2012-01-30 03:54:59 +01:00
hellogl Remove "All rights reserved" line from license headers. 2012-01-30 03:54:59 +01:00
hellogl_es clean up qmake-generated projects 2012-02-24 05:18:30 +01:00
hellogl_es2 clean up qmake-generated projects 2012-02-24 05:18:30 +01:00
hellowindow OpenGL/HelloWindow example: Fix resource leaks. 2012-05-25 21:42:14 +02:00
overpainting Remove "All rights reserved" line from license headers. 2012-01-30 03:54:59 +01:00
paintedwindow clean up qmake-generated projects 2012-02-24 05:18:30 +01:00
pbuffers Make gui/math3d classes use float rather than qreal 2012-09-07 13:27:38 +02:00
pbuffers2 clean up qmake-generated projects 2012-02-24 05:18:30 +01:00
samplebuffers Remove "All rights reserved" line from license headers. 2012-01-30 03:54:59 +01:00
shared Make gui/math3d classes use float rather than qreal 2012-09-07 13:27:38 +02:00
textures Remove "All rights reserved" line from license headers. 2012-01-30 03:54:59 +01:00
opengl.pro Examples, plugins: Remove remains of qpa in profiles. 2011-10-28 15:04:54 +02:00
README Remove references to demos from docs. 2011-07-05 19:57:54 +02:00

Qt provides support for integration with OpenGL implementations on all
platforms, giving developers the opportunity to display hardware accelerated
3D graphics alongside a more conventional user interface.

These examples demonstrate the basic techniques used to take advantage of
OpenGL in Qt applications.


Documentation for these examples can be found via the Examples
link in the main Qt documentation.