20,741
edits
Line 255: | Line 255: | ||
This would make it possible to neatly encapsulate optional subsystems, which could also be linked to a property listener - so that features could be switched on/off at runtime. | This would make it possible to neatly encapsulate optional subsystems, which could also be linked to a property listener - so that features could be switched on/off at runtime. | ||
It's also worth mentioning that base package files (XML, Nasal etc) may be trying to use disabled subsystems. | The initialization code in fg_init.cxx would then need to be adapted to delegate subsystem initialization to corresponding SGOptional<T> specialization, which would make this dependant on a property switch: | ||
<syntaxhighlight lang="cpp"> | |||
//////////////////////////////////////////////////////////////////// | |||
// Initialize the sound subsystem. | |||
//////////////////////////////////////////////////////////////////// | |||
// Sound manager uses an own subsystem group "SOUND" which is the last | |||
// to be updated in every loop. | |||
// Sound manager is updated last so it can use the CPU while the GPU | |||
// is processing the scenery (doubled the frame-rate for me) -EMH- | |||
globals->add_subsystem("sound", new SGSoundMgr("/enable/sound"), SGSubsystemMgr::SOUND); | |||
</syntaxhighlight> | |||
It's also worth mentioning that base package files (XML, Nasal etc) may be trying to use disabled subsystems, so this needs further care. | |||
Potential pitfalls are also discussed at [[FGCanvas#Open Issues]]. | Potential pitfalls are also discussed at [[FGCanvas#Open Issues]]. |