qt5base-lts/examples/opengl
Tor Arne Vestbø 6ff79478a4 Introduce platform API abstraction for QOpenGLContext
The API is available by including qopenglcontext.h as usual,
but scoped in the QPlatformInterface namespace. The namespace
exposes platform specific type-safe interfaces that provide:

 a) Factory functions for adopting native contexts, e.g.

    QCocoaGLContext::fromNative(nsContext, shareContext);

 b) Access to underlying native handles, e.g.

    openGLContext->platformInterface<QCocoaGLContext>->nativeContext()

 c) Platform specific functionality, e.g.

    static QWGLContext::openGLModuleHandle()

    openGLContext->platformInterface<QEGLContext>->doSomething();

The platform interfaces live close to the classes they extend,
removing the need for complex indirection and plumbing, and
avoids kitchen-sink modules and APIs such as the extras modules,
QPlatformFunctions, or QPlatformNativeInterface.

In the case of QOpenGLContext these platform APIs are backed
by the platform plugin, so dynamic_cast is used to ensure the
platform plugin supports the requested interface, but this is
and implementation detail. The interface APIs are agnostic
to where the implementation lives, while still being available
to the user as part of the APIs they extend/augment.

The documentation will be restored when the dust settles.

Task-number: QTBUG-80233
Change-Id: Iac612403383991c4b24064332542a6e4bcbb3293
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2020-07-02 10:27:50 +02:00
..
2dpainting Move QOpenGLWidget from QtOpenGL to its own module 2020-02-18 09:22:51 +01:00
computegles31 Post Merge Fixes 2020-01-24 12:29:18 +00:00
contextinfo Introduce platform API abstraction for QOpenGLContext 2020-07-02 10:27:50 +02:00
cube Replace calls to deprecated QEvent accessor functions 2020-06-08 19:11:51 +02:00
doc Merge remote-tracking branch 'origin/5.15' into dev 2020-04-08 20:11:39 +02:00
hellogl2 Use QList instead of QVector in examples 2020-06-23 14:01:11 +02:00
hellogles3 Post Merge Fixes 2020-01-24 12:29:18 +00:00
hellowindow Use QList instead of QVector in examples 2020-06-23 14:01:11 +02:00
openglwindow Post-merge fixes 2020-01-30 20:45:08 +00:00
paintedwindow Merge remote-tracking branch 'origin/5.15' into dev 2020-03-11 15:34:21 +01:00
qopenglwidget Use QList instead of QVector in examples 2020-06-23 14:01:11 +02:00
qopenglwindow Merge remote-tracking branch 'origin/5.15' into dev 2020-03-11 15:34:21 +01:00
textures Use QList instead of QVector in examples 2020-06-23 14:01:11 +02:00
threadedqopenglwidget Use QList instead of QVector in examples 2020-06-23 14:01:11 +02:00
CMakeLists.txt Post-merge fixes 2020-01-30 20:45:08 +00:00
opengl.pro Remove legacy OpenGL examples 2020-02-21 09:01:08 +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.