Canvas development: Difference between revisions

Jump to navigation Jump to search
Line 2,288: Line 2,288:
== Canvas Integration ==
== Canvas Integration ==
{{Note|Discuss FGCanvasSystemAdapter - for the time being, check out [[Howto:Extending_Canvas_to_support_rendering_3D_models#Extending_FGCanvasSystemAdapter]] to learn more about the purpose/usage of the CanvasSystemAdapter, which basically serves as a bridge between FlightGear and SimGear, i.e. to expose FG specific APIs to Canvas (which lives in SimGear).}}
{{Note|Discuss FGCanvasSystemAdapter - for the time being, check out [[Howto:Extending_Canvas_to_support_rendering_3D_models#Extending_FGCanvasSystemAdapter]] to learn more about the purpose/usage of the CanvasSystemAdapter, which basically serves as a bridge between FlightGear and SimGear, i.e. to expose FG specific APIs to Canvas (which lives in SimGear).}}
you don't need to move the view manager to SimGear to accomplish this - like I mentioned previously, the correct way to access FG-level subsystems via the Canvas system is to review/extend the FGCanvasSystemAdapter to expose the corresponding APIs.
I actually posted code snippets that illustrate how to do this, for example in the 3D model loader, specifically look for the FGCanvasSystemAdapter changes in both $FG_SRC and $SG_SRC
There is step by step instructions which can be found here: [[Howto:Extending Canvas to support rendering 3D models#Extending FGCanvasSystemAdapter]]
In other words: Any API that you need to access from the Canvas system would need a correspondinger "getter" added to retrieve the handle from the FG host application.
And that should be reflected in the header file
But the implementation would reside in $FG_SRC/Canvas/FGCanvasSystemAdapter.cxx - the SimGear code would only have a copy of the corresponding header file.<ref>{{cite web
  |url    =  https://forum.flightgear.org/viewtopic.php?p=317798#p317798
  |title  =  <nowiki> Re: Gear view in cockpit computer </nowiki>
  |author =  <nowiki> Hooray </nowiki>
  |date  =  Aug 29th, 2017
  |added  =  Aug 29th, 2017
  |script_version = 0.40
  }}</ref>


== Optimizing Canvas ==
== Optimizing Canvas ==

Navigation menu