diff options
author | Laszlo Agocs <laszlo.agocs@digia.com> | 2014-08-02 19:42:15 +0200 |
---|---|---|
committer | Laszlo Agocs <laszlo.agocs@digia.com> | 2014-08-12 07:47:23 +0200 |
commit | 611558d877a9ee4448b30e5443e3025c6235daaf (patch) | |
tree | 2a5d5a6da4a9994ccef4a49dec235f661a1e57f1 /examples/opengl/doc/src/hellogl2.qdoc | |
parent | 338f9c4f7c42d2a7bcd2c5b37137b3cc7cd9775d (diff) |
Modernize the OpenGL examples
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 <gunnar.sletta@jollamobile.com>
Diffstat (limited to 'examples/opengl/doc/src/hellogl2.qdoc')
-rw-r--r-- | examples/opengl/doc/src/hellogl2.qdoc | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/examples/opengl/doc/src/hellogl2.qdoc b/examples/opengl/doc/src/hellogl2.qdoc new file mode 100644 index 0000000000..adaf9d4719 --- /dev/null +++ b/examples/opengl/doc/src/hellogl2.qdoc @@ -0,0 +1,43 @@ +/**************************************************************************** +** +** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the documentation of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:FDL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Free Documentation License Usage +** Alternatively, this file may be used under the terms of the GNU Free +** Documentation License version 1.3 as published by the Free Software +** Foundation and appearing in the file included in the packaging of +** this file. Please review the following information to ensure +** the GNU Free Documentation License version 1.3 requirements +** will be met: http://www.gnu.org/copyleft/fdl.html. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +/*! + \example hellogl2 + \title Hello GL2 Example + \ingroup examples-widgets-opengl + + \brief The Hello GL2 example demonstrates the basic use of the OpenGL-related classes + provided with Qt. + + \image hellogl2-example.png + + Qt provides the QOpenGLWidget class to enable OpenGL graphics to be rendered + within a standard application user interface. By subclassing this class, and + providing reimplementations of event handler functions, 3D scenes can be + displayed on widgets that can be placed in layouts, connected to other + objects using signals and slots, and manipulated like any other widget. +*/ |