X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=docs-mini%2FREADME.introduction;h=8d4d8aab3d31957af7879862b320bd7b94724724;hb=0d9f2e3c9585cfc1fbc392e56c35fda8bef8c334;hp=0bdaaae8247443d7d20114f295dd3419e7718fbe;hpb=e4fc1541f493b23779f78448db02c2ca38f46b01;p=flightgear.git diff --git a/docs-mini/README.introduction b/docs-mini/README.introduction index 0bdaaae82..8d4d8aab3 100644 --- a/docs-mini/README.introduction +++ b/docs-mini/README.introduction @@ -45,6 +45,40 @@ Property I/O code allows one to easily read the tree from, or write the tree to an XML file. +Subsystems +---------- + +To add a new subsystem you would have to create a derived class from +SGSubsystem and define at least a small set of functions: + + class FGFX : public SGSubsystem + { + public: + + FGFX (); + virtual ~FGFX (); + + virtual void init (); + virtual void reinit (); + virtual void bind (); + virtual void unbind (); + virtual void update (double dt); + } + +The init() functions should make sure everything is set and ready so the +update() function can be run by the main loop. The reinit() function handles +everything in case of a reset by the user. + +The bind() and unbind() functions can be used to tie and untie properties. + +After that you can register this class at the subsystem manager: + + globals->add_subsystem("fx", new FGFX); + +Now the subsystem manager calls the update() function of this class every +frame. dt is the time (in seconds) elapsed since the last call. + + Scripting ---------