PUI: Difference between revisions

From FlightGear wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 1: Line 1:
{{Feature to be removed|reason=to help improve compatibility with OSG/OpenGL 3.x and improve performance by phasing out legacy OpenGL code. }}
[[File:Exit.png|thumb|FlightGear GUI dialog (exit.xml)stored in $FG_ROOT/gui/dialogs]]
[[File:Exit.png|thumb|FlightGear GUI dialog (exit.xml)stored in $FG_ROOT/gui/dialogs]]
{{GUI Navbar}}
{{GUI Navbar}}

Revision as of 17:20, 19 February 2016

Caution  The feature documented below, in its current form, is currently being scheduled/expected (or discussed) to be significantly updated, or phased out, in future FlightGear versions + (rough estimate). This should be taken into account if you're interested in working on the feature or developing it further. If in doubt, please get in touch via the devel list first.

(to help improve compatibility with OSG/OpenGL 3.x and improve performance by phasing out legacy OpenGL code.)

FlightGear GUI dialog (exit.xml)stored in $FG_ROOT/gui/dialogs


Custom-autopilot-dialog.png

PUI is the standard GUI engine used in FlightGear, it is part of PLIB and is using raw, fixed-pipeline, OpenGL code internally (no OpenSceneGraph). PUI provides a fairly basic, but robust, set of widgets. PUI is also used for rendering the Menubar:

Menubar2.jpg

In FlightGear, PUI dialogs are standard PropertyList XML Files that are stored in $FG_ROOT/gui/dialogs, they can contain the widgets mentioned in $FG_ROOT/Docs/README.gui, using a simple layout engine discussed in $FG_ROOT/Docs/README.layout, and bindings using a combination of so called fgcommands (see $FG_ROOT/Docs/README.commands) and custom Nasal code. In addition, each PUI/XML dialog may contain Nasal sections that are executed when opening/closing the dialog, a feature which is commonly used for procedurally creating/updating widgets using the cmdarg() API, which allows the dialog tree to be traversed and manipulated prior to the dialog being rendered.

PUI/XML dialogs can be loaded, updated and closed using a handful of fgcommands:

  • dialog-show
  • dialog-update
  • dialog-apply
  • dialog-close

PUI related OpenGL code is particularly infamous for causing rendering artifacts for people on AMD/ATI and Intel hardware (especially in combination with certain styles and effects/shaders).

PUI is also known to affect rendering performance quite significantly, while also preventing FlightGear from using a more recent version of OpenGL[1][2].

In addition, OpenSceneGraph (OSG) can obviously not help optimize any PUI related GL code and PUI widgets are generally considered to be pretty archaic and not easy to extend[3][4][5].

Note  We use the GUI code from PLIB, which doesn't know anything about OSG. See the SGPuDrawable class in $FG_SRC/Viewer/renderer.cxx for the implementation. The one catch is that OSG has a strong notion of separation between the update of a "scene" and its rendering, and that might not play well with arbitrary existing OpenGL code.

For these reasons, we're hoping to phase out PUI in FlightGear.

As of late 2015, there is heavy activity towards providing alternatives to a PUI-based UI: