MCPcopy Create free account
hub / github.com/baldurk/renderdoc / OnInjectTrigger

Method OnInjectTrigger

qrenderdoc/Windows/MainWindow.cpp:780–815  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

778}
779
780void MainWindow::OnInjectTrigger(uint32_t PID, const rdcarray<EnvironmentModification> &env,
781 const QString &name, CaptureOptions opts,
782 std::function<void(LiveCapture *)> callback)
783{
784 if(!PromptCloseCapture())
785 return;
786
787 LambdaThread *th = new LambdaThread([this, PID, env, name, opts, callback]() {
788 QString capturefile = m_Ctx.TempCaptureFilename(name);
789
790 ExecuteResult ret = RENDERDOC_InjectIntoProcess(PID, env, capturefile, opts, false);
791
792 GUIInvoke::call(this, [this, PID, ret, callback]() {
793 if(ret.result.code != ResultCode::Succeeded)
794 {
795 RDDialog::critical(
796 this, tr("Error injecting into process"),
797 tr("Error injecting into process %1 for capture.\n\n%2").arg(PID).arg(ret.result.Message()));
798 return;
799 }
800
801 LiveCapture *live = new LiveCapture(m_Ctx, QString(), QString(), ret.ident, this, this);
802 ShowLiveCapture(live);
803 callback(live);
804 });
805 });
806 th->start();
807 // wait a few ms before popping up a progress bar
808 th->wait(500);
809 if(th->isRunning())
810 {
811 ShowProgressDialog(this, tr("Injecting into %1, please wait...").arg(PID),
812 [th]() { return !th->isRunning(); });
813 }
814 th->deleteLater();
815}
816
817void MainWindow::LoadCapture(const QString &filename, const ReplayOptions &opts, bool temporary,
818 bool local)

Callers 1

GetCaptureDialogMethod · 0.80

Calls 10

criticalFunction · 0.85
ShowProgressDialogFunction · 0.85
trFunction · 0.50
QStringFunction · 0.50
TempCaptureFilenameMethod · 0.45
argMethod · 0.45
startMethod · 0.45
waitMethod · 0.45
isRunningMethod · 0.45

Tested by

no test coverage detected