Add a preview window ability to remote servers. Always on for android

* On android in particular this shows some sense of what's happening on
  the device and gives user feedback that it's not completely dead.
This commit is contained in:
baldurk
2018-01-01 17:31:23 +00:00
parent 7a2305ae31
commit 96e39cb781
12 changed files with 499 additions and 51 deletions
+13 -1
View File
@@ -474,6 +474,7 @@ struct RemoteServerCommand : public Command
"host", 'h', "The interface to listen on. By default listens on all interfaces", false, "");
parser.add<uint32_t>("port", 'p', "The port to listen on.", false,
RENDERDOC_GetDefaultRemoteServerPort());
parser.add("preview", 'v', "Display a preview window when a replay is active.");
}
virtual const char *Description()
{
@@ -499,8 +500,19 @@ struct RemoteServerCommand : public Command
usingKillSignal = true;
// by default have a do-nothing callback that creates no windows
RENDERDOC_PreviewWindowCallback previewWindow;
// if the user asked for a preview, then call to the platform-specific preview function
if(parser.exist("preview"))
previewWindow = &DisplayRemoteServerPreview;
// OR if the platform-specific preview function always has a window, then return it anyway.
if(DisplayRemoteServerPreview(false, {}).system != WindowingSystem::Unknown)
previewWindow = &DisplayRemoteServerPreview;
RENDERDOC_BecomeRemoteServer(host.empty() ? NULL : host.c_str(), port,
[]() { return killSignal; });
[]() { return killSignal; }, previewWindow);
std::cerr << std::endl << "Cleaning up from replay hosting." << std::endl;