mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-08-26 08:26:50 +00:00
Add helper menu items to tools menu if rdocself.dll is loaded
This commit is contained in:
@@ -36,6 +36,8 @@ namespace renderdocui.Code
|
||||
{
|
||||
[DllImport("kernel32", SetLastError = true, CharSet = CharSet.Unicode)]
|
||||
public static extern IntPtr LoadLibrary(string lpFileName);
|
||||
[DllImport("kernel32", SetLastError = true, CharSet = CharSet.Unicode)]
|
||||
public static extern IntPtr GetModuleHandle(string lpFileName);
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public struct POINT
|
||||
|
||||
@@ -176,6 +176,23 @@ namespace renderdocui.Windows
|
||||
{
|
||||
bool loaded = LoadLayout(0);
|
||||
|
||||
if (Win32PInvoke.GetModuleHandle("rdocself.dll") != IntPtr.Zero)
|
||||
{
|
||||
ToolStripMenuItem beginSelfCap = new ToolStripMenuItem();
|
||||
beginSelfCap.Text = "Start Self-hosted Capture";
|
||||
beginSelfCap.Click += new EventHandler((object o, EventArgs a) => { StaticExports.StartSelfHostCapture("rdocself.dll"); });
|
||||
|
||||
ToolStripMenuItem endSelfCap = new ToolStripMenuItem();
|
||||
endSelfCap.Text = "End Self-hosted Capture";
|
||||
endSelfCap.Click += new EventHandler((object o, EventArgs a) => { StaticExports.EndSelfHostCapture("rdocself.dll"); });
|
||||
|
||||
toolsToolStripMenuItem.DropDownItems.AddRange(new ToolStripItem[] {
|
||||
new System.Windows.Forms.ToolStripSeparator(),
|
||||
beginSelfCap,
|
||||
endSelfCap,
|
||||
});
|
||||
}
|
||||
|
||||
CheckUpdates();
|
||||
|
||||
Thread remoteStatusThread = Helpers.NewThread(new ThreadStart(() =>
|
||||
|
||||
Reference in New Issue
Block a user