qt5base-lts/examples/opengl/textures
Laszlo Agocs 5ebb9a8bf3 Tune textures example to work with wasm and update docs
Old examples inherited from Qt 4 tend to set some state, such as
enabling the depth test or culling, in initializeGL(). Newer examples
tend not to do this; they rather set the necessary state in paintGL().

This mattered little (or not at all) in the past, but with WebAssembly
and WebGL there are limitations in the GL context management in the
wasm platform plugin. Under certain conditions, esp. when
QOffscreenSurface is involved, it looks like the same native context
gets reused, which means there is a chance of unexpected changes to
the current state between calls to initializeGL() and paintGL(). (and
also between paintGL() calls) See QWasmOpenGLContext for details.

Update the textures example the same way we did for the cube one.

Add a note to the QOpenGLWidget docs about this problem.

Task-number: QTBUG-111304
Pick-to: 6.5 6.4
Change-Id: I29d2b2cdeb07bcecc5dc915d79c12b4323ca9ab3
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Reviewed-by: Inho Lee <inho.lee@qt.io>
2023-04-25 18:10:44 +02:00
..
images Initial import from the monolithic Qt. 2011-04-27 12:05:43 +02:00
CMakeLists.txt Examples: Use PRIVATE CMake linkage 2022-11-30 14:48:50 +01:00
glwidget.cpp Tune textures example to work with wasm and update docs 2023-04-25 18:10:44 +02:00
glwidget.h Use SPDX license identifiers 2022-05-16 16:37:38 +02:00
main.cpp Use SPDX license identifiers 2022-05-16 16:37:38 +02:00
textures.pro Move QOpenGLWidget from QtOpenGL to its own module 2020-02-18 09:22:51 +01:00
textures.qrc Initial import from the monolithic Qt. 2011-04-27 12:05:43 +02:00
window.cpp Use SPDX license identifiers 2022-05-16 16:37:38 +02:00
window.h Use SPDX license identifiers 2022-05-16 16:37:38 +02:00