From a9e0ec843bdf8d066c9bfd81e98d85d581076ca3 Mon Sep 17 00:00:00 2001 From: Edward d'Auvergne Date: Thu, 19 Apr 2018 14:01:28 +0200 Subject: [PATCH] Documentation: Generalised the subsystem example. --- docs-mini/README.introduction | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/docs-mini/README.introduction b/docs-mini/README.introduction index 8d8030f47..0e84a491f 100644 --- a/docs-mini/README.introduction +++ b/docs-mini/README.introduction @@ -51,11 +51,11 @@ 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 + class FGSubsystemExample : public SGSubsystem { public: - FGFX(); - virtual ~FGFX(); + FGSubsystemExample(); + virtual ~FGSubsystemExample(); // Subsystem API. void bind() override; @@ -65,7 +65,7 @@ SGSubsystem and define at least a small set of functions: void update(double dt) override; // Subsystem identification. - static const char* subsystemName() { return "fx"; } + static const char* subsystemName() { return "subsystem-example"; } }; The init() functions should make sure everything is set and ready so the @@ -76,7 +76,7 @@ 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); + globals->add_subsystem("example", new FGSubsystemExample); Now the subsystem manager calls the update() function of this class every frame. dt is the time (in seconds) elapsed since the last call.