mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-05 01:20:42 +00:00
Add self-hosting tool menu items on windows
This commit is contained in:
@@ -69,6 +69,10 @@ struct Version
|
||||
static bool isMismatched() { return RENDERDOC_GetVersionString() != bareString(); }
|
||||
};
|
||||
|
||||
#if defined(Q_OS_WIN32)
|
||||
extern "C" void *GetModuleHandleA(const char *);
|
||||
#endif
|
||||
|
||||
MainWindow::MainWindow(CaptureContext &ctx) : QMainWindow(NULL), ui(new Ui::MainWindow), m_Ctx(ctx)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
@@ -229,6 +233,33 @@ MainWindow::MainWindow(CaptureContext &ctx) : QMainWindow(NULL), ui(new Ui::Main
|
||||
ui->toolWindowManager->areaOf(eventBrowser), 0.3f));
|
||||
}
|
||||
|
||||
#if defined(Q_OS_WIN32)
|
||||
if(GetModuleHandleA("rdocself.dll"))
|
||||
{
|
||||
QAction *begin = new QAction(tr("Start Self-hosted Capture"), this);
|
||||
QAction *end = new QAction(tr("End Self-hosted Capture"), this);
|
||||
end->setEnabled(false);
|
||||
|
||||
QObject::connect(begin, &QAction::triggered, [begin, end]() {
|
||||
begin->setEnabled(false);
|
||||
end->setEnabled(true);
|
||||
|
||||
RENDERDOC_StartSelfHostCapture("rdocself.dll");
|
||||
});
|
||||
|
||||
QObject::connect(end, &QAction::triggered, [begin, end]() {
|
||||
begin->setEnabled(true);
|
||||
end->setEnabled(false);
|
||||
|
||||
RENDERDOC_EndSelfHostCapture("rdocself.dll");
|
||||
});
|
||||
|
||||
ui->menu_Tools->addSeparator();
|
||||
ui->menu_Tools->addAction(begin);
|
||||
ui->menu_Tools->addAction(end);
|
||||
}
|
||||
#endif
|
||||
|
||||
m_Ctx.AddLogViewer(this);
|
||||
}
|
||||
|
||||
|
||||
@@ -642,6 +642,9 @@ RENDERDOC_ExecuteAndInject(const char *app, const char *workingDir, const char *
|
||||
extern "C" RENDERDOC_API uint32_t RENDERDOC_CC RENDERDOC_InjectIntoProcess(
|
||||
uint32_t pid, void *env, const char *logfile, const CaptureOptions *opts, bool32 waitForExit);
|
||||
|
||||
extern "C" RENDERDOC_API void RENDERDOC_CC RENDERDOC_StartSelfHostCapture(const char *dllname);
|
||||
extern "C" RENDERDOC_API void RENDERDOC_CC RENDERDOC_EndSelfHostCapture(const char *dllname);
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// Vulkan layer handling
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
Reference in New Issue
Block a user