Howto:Add new fgcommands to FlightGear: Difference between revisions

Jump to navigation Jump to search
Line 214: Line 214:


In addition to directly editing the default initialization routine in fg_init.cxx, you can also dynamically add/remove fgcommands from your SGSubsystem, by getting a handle to the SGCommandMgr singleton, specifying a command name, and a corresponding callback (which can be a static member of your SGSubsystem):
In addition to directly editing the default initialization routine in fg_init.cxx, you can also dynamically add/remove fgcommands from your SGSubsystem, by getting a handle to the SGCommandMgr singleton, specifying a command name, and a corresponding callback (which can be a static member of your SGSubsystem):
<syntaxhighlight lang="php">
<syntaxhighlight lang="cpp">
#include <simgear/structure/commands.hxx>
#include <simgear/structure/commands.hxx>
...
...

Navigation menu