Unifying the 2D rendering backend via canvas: Difference between revisions

Jump to navigation Jump to search
Switch to {{flightgear source}} and {{flightgear url}} to fix the broken Gitorious links. Some file paths have been updated to their new positions.
(Switch to {{flightgear source}} and {{flightgear url}} to fix the broken Gitorious links. Some file paths have been updated to their new positions.)
Line 69: Line 69:
The idea is to provide Nasal wrappers for these systems, which implement the existing behavior using the canvas system, so that the old C++ code can be eventually phased out. In particular, this means that wrappers for the following systems will be added:  
The idea is to provide Nasal wrappers for these systems, which implement the existing behavior using the canvas system, so that the old C++ code can be eventually phased out. In particular, this means that wrappers for the following systems will be added:  


* HUD: https://gitorious.org/fg/flightgear/trees/next/src/Instrumentation/HUD
* HUD: {{flightgear url|src/Instrumentation/HUD}}
* 2D PANEL: https://gitorious.org/fg/flightgear/blobs/next/src/Cockpit/
* 2D PANEL: {{flightgear url|src/Cockpit}}
* GUI: https://gitorious.org/fg/flightgear/blobs/next/src/GUI/FGPUIDialog.cxx#line709 (currently in progress, see [[Canvas Widgets]])
* GUI: {{flightgear url|src/GUI/FGPUIDialog.cxx|line=709}} (currently in progress, see [[Canvas Widgets]])


Note that the API-requirements will be pretty much identical for GUI widgets and MFD-screens with touch screen functionality, both features will need a way to deal with keyboard/mouse input.
Note that the API-requirements will be pretty much identical for GUI widgets and MFD-screens with touch screen functionality, both features will need a way to deal with keyboard/mouse input.
Line 80: Line 80:
To ensure that the Canvas/GUI wrapper is flexible enough, we need to take a look at existing hard coded PUI dialogs/widgets, and make sure that these can be theoretically reimplemented using Canvas/Nasal, and add any missing hooks as required:
To ensure that the Canvas/GUI wrapper is flexible enough, we need to take a look at existing hard coded PUI dialogs/widgets, and make sure that these can be theoretically reimplemented using Canvas/Nasal, and add any missing hooks as required:


* property list widget: https://gitorious.org/fg/flightgear/blobs/next/src/GUI/property_list.cxx
* property list widget: {{flightgear url|src/GUI/property_list.cxx}}
* waypoint list widget:  https://gitorious.org/fg/flightgear/blobs/next/src/GUI/WaypointList.cxx
* waypoint list widget:  {{flightgear url|src/GUI/WaypointList.cxx}}
* map widget: https://gitorious.org/fg/flightgear/blobs/next/src/GUI/MapWidget.cxx
* map widget: {{flightgear url|src/GUI/MapWidget.cxx}}


Also, the Canvas subsystem should be powerful enough to allow re-implementing existing hard-coded [https://gitorious.org/fg/flightgear/blobs/next/src/Instrumentation/od_gauge.cxx od_gauge instruments], such as:
Also, the Canvas subsystem should be powerful enough to allow re-implementing existing hard-coded {{flightgear source|src/Cockpit/od_gauge.cxx|text=od_gauge instruments}}, such as:


* dclgps: https://gitorious.org/fg/flightgear/blobs/next/src/Instrumentation/dclgps.cxx
* dclgps: {{flightgear url|src/Instrumentation/dclgps.cxx}}
* kln89: https://gitorious.org/fg/flightgear/trees/next/src/Instrumentation/KLN89
* kln89: {{flightgear url|src/Instrumentation/KLN89}}
* groundradar: https://gitorious.org/fg/flightgear/blobs/next/src/Instrumentation/groundradar.cxx
* groundradar: {{flightgear url|src/Cockpit/groundradar.cxx}}
* wxRadar: https://gitorious.org/fg/flightgear/blobs/next/src/Instrumentation/wxradar.cxx
* wxRadar: {{flightgear url|src/Cockpit/wxradar.cxx}}
* agradar: https://gitorious.org/fg/flightgear/blobs/next/src/Instrumentation/agradar.cxx
* agradar: {{flightgear url|src/Cockpit/agradar.cxx}}
* [[TCAS]]: https://gitorious.org/fg/flightgear/blobs/next/src/Instrumentation/tcas.cxx  
* [[TCAS]]: {{flightgear url|src/Instrumentation/tcas.cxx}}
* NavDisplay: https://gitorious.org/fg/flightgear/blobs/next/src/Instrumentation/NavDisplay.cxx
* NavDisplay: {{flightgear url|src/Cockpit/NavDisplay.cxx}}


We need to take a look at these instruments and their C++ code, to ensure that the Canvas API is sufficiently customizable to implement these and similar instruments purely in scripting space.
We need to take a look at these instruments and their C++ code, to ensure that the Canvas API is sufficiently customizable to implement these and similar instruments purely in scripting space.


As of 07/2012 the navdb (including airports, runways etc) is fully exposed as part of the NasalPositioned module in $FG_SRC/Scripting: https://gitorious.org/fg/flightgear/blobs/next/src/Scripting/NasalPositioned.cxx
As of 07/2012 the navdb (including airports, runways etc) is fully exposed as part of the NasalPositioned module in $FG_SRC/Scripting: {{flightgear url|src/Scripting/NasalPositioned.cxx}}.

Navigation menu