20,741
edits
(http://forum.flightgear.org/viewtopic.php?p=195694#p195694) |
m (→Background: http://forum.flightgear.org/viewtopic.php?p=198150#p198150) |
||
Line 20: | Line 20: | ||
== Background == | == Background == | ||
Canvas MFD displays are just canvas textures, which are just represented as "properties", or rather, "property branches" - in the form of /canvas/by-index/texture[x] - you can use the property tree browser to check how these work - but basically, each canvas texture can have multiple "placements", such as "aircraft", "scenery" or GUI (dialog/window) - these placements maintain a reference count internally. | |||
Toggling between different image sources is also accomplished by supporting recursion through "nested canvases" - i.e. a canvas can "include" (reference) another canvas and use it as the image source (raster image). | |||
Thus, technically, the only thing involved would be coming up with two classes for "displays" and "image generators" - where each would be internally mapped to a canvas texture, the image generator would be "black box" where rendering takes place - while the "display" would be just a simple canvas that references the proper canvas texture, based on the currently selected switch/mode. | |||
Meanwhile, I would prefer coming up with a real MFD framework that manages different displays/screens and image sources. | Meanwhile, I would prefer coming up with a real MFD framework that manages different displays/screens and image sources. | ||