qt5base-lts/examples/opengl
Edward Welbourne 29af390e3f Clean up some arithmetic code in an example
The square root of a sum of squares is easier to read and should be
computed more accurately if done for us by hypot().  Variables set
only once should be set as an initializer and declared const, to make
clear this is what's happening.  Loop variables can be local to loops.
Adding a value to, or subtracting one from, a multiple of itself just
multiplies it be one plus (or minus) the multiplier; assigning the
result to the same variable is clearer as a *= (especially when the
factors are now overt numeric constants).  An array of 16k floats all
updated in locksteck to the same value can be replaced by a single
float that holds that value.  Simple things should not be needlessly
made more complicated - especially in example code, which should be
pedagogic.

Change-Id: Idab585cd7df1399c250d4b9f1396a085ae8f3864
Reviewed-by: hjk <hjk@qt.io>
2017-07-14 13:36:46 +00:00
..
2dpainting Examples: Replace 'Q_DECL_OVERRIDE' by 'override' 2016-06-15 09:32:30 +00:00
computegles31 Fix computegles31 example 2017-03-08 09:19:39 +00:00
contextinfo Examples: Replace 'Q_DECL_OVERRIDE' by 'override' 2016-06-15 09:32:30 +00:00
cube Examples: Replace 'Q_DECL_OVERRIDE' by 'override' 2016-06-15 09:32:30 +00:00
doc Unify license header usage. 2016-03-29 10:20:03 +00:00
hellogl2 Examples: Replace 'Q_DECL_OVERRIDE' by 'override' 2016-06-15 09:32:30 +00:00
hellogles3 Unify license header usage. 2016-03-29 10:20:03 +00:00
hellowindow Don’t flicker on startup: render on expose 2017-06-27 23:51:15 +00:00
legacy Clean up some arithmetic code in an example 2017-07-14 13:36:46 +00:00
paintedwindow examples: Use QOverload to select overloaded signals and slots 2016-12-22 14:54:55 +00:00
qopenglwidget Be (somewhat more) consistent about the value of pi 2017-06-20 09:53:46 +00:00
qopenglwindow Be (somewhat more) consistent about the value of pi 2017-06-20 09:53:46 +00:00
textures Examples: Replace 'Q_DECL_OVERRIDE' by 'override' 2016-06-15 09:32:30 +00:00
threadedqopenglwidget Be (somewhat more) consistent about the value of pi 2017-06-20 09:53:46 +00:00
opengl.pro OpenGL: add support for compute shaders in GLES 3.1 2016-09-21 16:45:50 +00: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.