Howto:Extend Nasal: Difference between revisions

Jump to navigation Jump to search
m
Line 12: Line 12:


Most of the code in the Nasal subsystem itself (FGNasalSys) also still uses the legacy C APIs - this is just to explain the two approaches, to avoid unnecessary confusion.
Most of the code in the Nasal subsystem itself (FGNasalSys) also still uses the legacy C APIs - this is just to explain the two approaches, to avoid unnecessary confusion.
Overall, it's a good idea to favor cppbind over the low-level approach documented here, it isn't only much more elegant, but also saves you tons of typing, too   
Overall, it's a good idea to favor cppbind over the low-level approach documented here, it isn't only much more elegant, but also saves you tons of typing and time, too   


The new cppbind framework makes heavy use of modern C++, so that C++ data structures and classes/methods can now be easily exposed to Nasal space and vice versa.
The new cppbind framework makes heavy use of modern C++, so that C++ data structures and classes/methods (including templates) can now be easily exposed to Nasal space and vice versa.


Implementation examples are to be found in $FG_SRC/Scripting.
Implementation examples are to be found in $FG_SRC/Scripting.
Line 22: Line 22:
Some of the more straightforward things to play with would be exposing useful SG/FG classes to Nasal space, such as the SGSubsystem interface to register scripted SGSubsystems, or the autopilot system.
Some of the more straightforward things to play with would be exposing useful SG/FG classes to Nasal space, such as the SGSubsystem interface to register scripted SGSubsystems, or the autopilot system.


For more technical Nasal questions (C API, internals etc), you'll probably want to refer to the forum, in particular: Philosopher, TheTom, Zakalawe or Hooray - TheTom and Zakalawe can also provide help on using cppbind, having both used it extensively during the last months.
For more technical Nasal questions (C API, internals etc), you'll probably want to refer to the forum, in particular: Philosopher, TheTom, Zakalawe or Hooray - TheTom and Zakalawe can also provide help on using cppbind, having both used it extensively while developing/extending the Canvas system.


== Pre-requisites ==
== Pre-requisites ==

Navigation menu