mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-04 17:10:47 +00:00
Add helper menu items to tools menu if rdocself.dll is loaded
This commit is contained in:
@@ -22,6 +22,7 @@
|
||||
<ProjectGuid>{D03DF2F9-513C-4084-BBDD-1DEE8D9250D7}</ProjectGuid>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
<RootNamespace>renderdoccmd</RootNamespace>
|
||||
<ProjectName>renderdoccmd</ProjectName>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Development|Win32'" Label="Configuration">
|
||||
|
||||
@@ -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