Hi fellow wiki editors!

To help newly registered users get more familiar with the wiki (and maybe older users too) there is now a {{Welcome to the wiki}} template. Have a look at it and feel free to add it to new users discussion pages (and perhaps your own).

I have tried to keep the template short, but meaningful. /Johan G

Changes

Jump to: navigation, search

FlightGear Headless

1,259 bytes added, 12:18, 16 July 2017
m
Proof of concept (patch): https://forum.flightgear.org/viewtopic.php?f=36&t=30050&p=314434#
}}
</ref>
 
<syntaxhighlight lang="diff">
diff --git a/src/Main/options.cxx b/src/Main/options.cxx
index db5d84d..fb63dd1 100644
--- a/src/Main/options.cxx
+++ b/src/Main/options.cxx
@@ -1797,6 +1797,7 @@ struct OptionDesc {
{"prop", true, OPTION_FUNC | OPTION_MULTI, "", false, "", fgOptSetProperty},
{"load-tape", true, OPTION_FUNC, "", false, "", fgOptLoadTape },
{"developer", true, OPTION_IGNORE | OPTION_BOOL, "", false, "", nullptr },
+ {"enable-headless", false, OPTION_BOOL, "/sim/startup/headless-mode", true, "",0 },
{0}
};
diff --git a/src/Viewer/WindowBuilder.cxx b/src/Viewer/WindowBuilder.cxx
index f4d3c33..a1ffb84 100644
--- a/src/Viewer/WindowBuilder.cxx
+++ b/src/Viewer/WindowBuilder.cxx
@@ -149,6 +149,12 @@ void WindowBuilder::makeDefaultTraits(bool stencil)
SG_LOG(SG_VIEW,SG_DEBUG,"Using initial window size: " << w << " x " << h);
}
}
+bool headless = fgGetBool("/sim/startup/headless-mode", false);
+if (headless) {
+ SG_LOG(SG_VIEW, SG_ALERT, "Headless view required: rendering window to pbuffer");
+ traits->pbuffer = true;
+} // enable headless
+
}
} // of namespace flightgear
</syntaxhighlight>
 
For reference, to disable the window. It's the last thing before the return statement in WindowBuilder::makeDefaultTraits(bool stencil):
18,174
edits

Navigation menu