Board index FlightGear Development Canvas

element/group "pointers" (caching)

Canvas is FlightGear's new fully scriptable 2D drawing system that will allow you to easily create new instruments, HUDs and even GUI dialogs and custom GUI widgets, without having to write C++ code and without having to rebuild FlightGear.

element/group "pointers" (caching)

Postby Hooray » Mon Sep 24, 2012 11:11 am

The canvas knows already how to reuse another canvas texture - now, for mapping purposes, we'll be dealing with lots of vector data that will be the same (navaids, fixes, waypoints), and that just need to be transformed in most cases.

Currently,I am loading SVG files separately - but what we should really be doing is supporting an "element/group" cache, so that sub trees can be marked to be available in a global (or texture-specific) cache, looked up via s special syntax.

That would make it possible to load an SVG file only once and from then on just specify "cache://by-index/". Obviously, we'd want to maintain a refcount then, and it shouldn't be allowed to call removeAllChildren if the group's refcount is > 1.

We could then also look at supporting persistent caching and storing raster images in $FG_HOME/cache/canvas
Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 11437
Joined: Tue Mar 25, 2008 8:40 am

Return to Canvas

Who is online

Users browsing this forum: No registered users and 1 guest