diff --git a/src/Main/globals.cxx b/src/Main/globals.cxx index 83f74b8e9..6547777bf 100644 --- a/src/Main/globals.cxx +++ b/src/Main/globals.cxx @@ -161,7 +161,8 @@ FGGlobals::FGGlobals() : channel_options_list( NULL ), initial_waypoints( NULL ), channellist( NULL ), - haveUserSettings(false) + haveUserSettings(false), + _headless(false) { SGPropertyNode* root = new SGPropertyNode; props = SGPropertyNode_ptr(root); @@ -923,4 +924,14 @@ void FGGlobals::setPackageRoot(const SGSharedPtr& p) _packageRoot = p; } +bool FGGlobals::is_headless() +{ + return _headless; +} + +void FGGlobals::set_headless(bool mode) +{ + _headless = mode; +} + // end of globals.cxx diff --git a/src/Main/globals.hxx b/src/Main/globals.hxx index fad0fee3c..877b0411e 100644 --- a/src/Main/globals.hxx +++ b/src/Main/globals.hxx @@ -156,6 +156,9 @@ private: SGPropertyChangeListenerVec _listeners_to_cleanup; SGSharedPtr _packageRoot; + + bool _headless; + public: FGGlobals(); @@ -404,6 +407,12 @@ public: simgear::pkg::Root* packageRoot(); void setPackageRoot(const SGSharedPtr& p); + + /** + * A runtime headless mode for running without a GUI. + */ + bool is_headless(); + void set_headless(bool mode); };