Skip to content

Commit

Permalink
Enabled headless mode, as per wiki on Flightgear_headless.
Browse files Browse the repository at this point in the history
  • Loading branch information
badotter committed Jan 28, 2020
1 parent 973bf32 commit 6a589d0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Main/options.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -1846,7 +1846,8 @@ 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 },
{"jsbsim-output-directive-file", true, OPTION_STRING, "/sim/jsbsim/output-directive-file", false, "", nullptr },
{"jsbsim-output-directive-file", true, OPTION_STRING, "/sim/jsbsim/output-directive-file", false, "", nullptr},
{"enable-headless", false, OPTION_BOOL, "/sim/startup/headless-mode", true, "", 0},
{0}
};

Expand Down
5 changes: 5 additions & 0 deletions src/Viewer/WindowBuilder.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,11 @@ 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
Expand Down

0 comments on commit 6a589d0

Please sign in to comment.