Document the in-application API properly

This commit is contained in:
baldurk
2016-04-23 11:36:17 +02:00
parent c145de9d16
commit b14b771000
4 changed files with 785 additions and 3 deletions
+773
View File
@@ -0,0 +1,773 @@
<?xml version="1.0" encoding="utf-8"?>
<topic id="b32454b2-9dff-41e3-8d56-a9607702e51c" revisionNumber="1">
<developerConceptualDocument xmlns="http://ddue.schemas.microsoft.com/authoring/2003/5" xmlns:xlink="http://www.w3.org/1999/xlink">
<summary>
<para>Reference for RenderDoc in-application API</para>
</summary>
<introduction>
<autoOutline>0</autoOutline>
<para>This page describes the RenderDoc API exposed to applications being captured, both in
overall organisation as well as a specific reference on each function.</para>
</introduction>
<section address="Overview">
<title>Overview</title>
<content>
<para>Overview text</para>
</content>
</section>
<section address="GetAPIVersion">
<title>GetAPIVersion</title>
<content>
<para><codeInline>void GetAPIVersion(int *major, int *minor, int *patch);</codeInline></para>
<para>
This function returns the actual API version of the implementation returned. Version numbers
follow <externalLink>
<linkText>semantic versioning</linkText>
<linkAlternateText>Semantic Versioning information</linkAlternateText>
<linkUri>http://semver.org/</linkUri>
</externalLink> which means the implementation returned may have a higher minor and/or patch version than requested:
New patch versions are identical and backwards compatible in functionality.
New minor versions add new functionality in a backwards compatible way.
</para>
</content>
<sections>
<section>
<title>Parameters</title>
<content>
<para><codeInline>GetAPIVersion()</codeInline></para>
<list class="bullet">
<listItem><para><codeInline>int *major</codeInline> will be filled with the major version of the implementation's version.</para></listItem>
<listItem><para><codeInline>int *minor</codeInline> will be filled with the minor version of the implementation's version.</para></listItem>
<listItem><para><codeInline>int *patch</codeInline> which will be filled with the patch version of the implementation's version.</para></listItem>
</list>
</content>
</section>
<section>
<title>Return Value</title>
<content>
<para>None</para>
</content>
</section>
</sections>
</section>
<section address="SetCaptureOption">
<title>SetCaptureOptionU32 and SetCaptureOptionF32</title>
<content>
<para><codeInline>void SetCaptureOptionU32(RENDERDOC_CaptureOption opt, uint32_t val);</codeInline></para>
<para><codeInline>void SetCaptureOptionF32(RENDERDOC_CaptureOption opt, float val);</codeInline></para>
<para>
This pair of functions sets one of the different options for tweaking some behaviours of capturing. Note that each option only takes
effect from after it is set - so it is advised to set these options as early as possible, ideally before any graphics API
has been initialised.
</para>
</content>
<sections>
<section>
<title>Parameters</title>
<content>
<para><codeInline>SetCaptureOptionU32()</codeInline></para>
<list class="bullet">
<listItem><para><codeInline>RENDERDOC_CaptureOption opt</codeInline> specifies which capture option should be set.</para></listItem>
<listItem><para><codeInline>uint32_t val</codeInline> the unsigned integer value to set for the above option.</para></listItem>
</list>
<para><codeInline>SetCaptureOptionF32()</codeInline></para>
<list class="bullet">
<listItem><para><codeInline>RENDERDOC_CaptureOption opt</codeInline> specifies which capture option should be set.</para></listItem>
<listItem><para><codeInline>float val</codeInline> the floating point value to set for the above option.</para></listItem>
</list>
</content>
</section>
<section>
<title>Notes</title>
<content>
<para><codeInline>RENDERDOC_CaptureOption opt</codeInline> can take one of the following values:</para>
<list class="bullet">
<listItem><para><codeInline>eRENDERDOC_Option_AllowVSync</codeInline> specifies whether the application is allowed to enable vsync. Default is on.</para></listItem>
<listItem><para><codeInline>eRENDERDOC_Option_AllowFullscreen</codeInline> specifies whether the application is allowed to enter exclusive fullscreen. Default is on.</para></listItem>
<listItem><para><codeInline>eRENDERDOC_Option_DebugDeviceMode</codeInline> specifies whether (where possible) API-specific debugging is enabled. Default is off.</para></listItem>
<listItem><para><codeInline>eRENDERDOC_Option_CaptureCallstacks</codeInline> specifies whether each API call should save a callstack. Default is off.</para></listItem>
<listItem><para><codeInline>eRENDERDOC_Option_CaptureCallstacksOnlyDraws</codeInline> specifies whether - if <codeInline>CaptureCallstacks</codeInline> is enabled - callstacks are only saved on drawcalls. Default is off.</para></listItem>
<listItem><para><codeInline>eRENDERDOC_Option_DelayForDebugger</codeInline> specifies a delay in seconds after launching a process to pause, to allow debuggers to attach. Default is 0.</para></listItem>
<listItem><para><codeInline>eRENDERDOC_Option_VerifyMapWrites</codeInline> specifies whether any 'map' type resource memory updates should be bounds-checked for overruns. Default is off.</para></listItem>
<listItem><para><codeInline>eRENDERDOC_Option_HookIntoChildren</codeInline> specifies whether child processes launched by the initial application should be hooked as well - commonly if a launcher process is needed to run the application. Default is off.</para></listItem>
<listItem><para><codeInline>eRENDERDOC_Option_RefAllResources</codeInline> specifies whether all live resources at the time of capture should be included in the log, even if they are not referenced by the frame. Default is off.</para></listItem>
<listItem><para><codeInline>eRENDERDOC_Option_SaveAllInitials</codeInline> specifies whether all initial states of resources at the start of the frame should be saved, rather than omitting large resource contents which are detected to be likely unused. Default is off.</para></listItem>
<listItem><para><codeInline>eRENDERDOC_Option_CaptureAllCmdLists</codeInline> specifies whether all command lists should be captured on APIs where multithreaded submission is not optimal such as D3D11, rather than only capturing those submitted during the frame. Default is off.</para></listItem>
<listItem><para><codeInline>eRENDERDOC_Option_DebugOutputMute</codeInline> specifies whether to mute any API debug output messages when <codeInline>DebugDeviceMode</codeInline> is enabled. Default is on.</para></listItem>
</list>
</content>
</section>
<section>
<title>Return Value</title>
<content>
<para>The functions return <codeInline>1</codeInline> if the option is valid, and the value set on the option is within valid ranges.</para>
<para>The functions return <codeInline>0</codeInline> if the option is not a <codeInline>RENDERDOC_CaptureOption</codeInline> enum, or the value is not valid for the option.</para>
</content>
</section>
</sections>
</section>
<section address="GetCaptureOption">
<title>GetCaptureOptionU32 and GetCaptureOptionF32</title>
<content>
<para><codeInline>uint32_t GetCaptureOptionU32(RENDERDOC_CaptureOption opt);</codeInline></para>
<para><codeInline>float GetCaptureOptionF32(RENDERDOC_CaptureOption opt);</codeInline></para>
<para>
This pair of functions gets the current value of one of the different options listed above in <link xlink:href="b32454b2-9dff-41e3-8d56-a9607702e51c#SetCaptureOption">SetCaptureOption</link>.
</para>
</content>
<sections>
<section>
<title>Parameters</title>
<content>
<para><codeInline>GetCaptureOptionU32()</codeInline></para>
<list class="bullet">
<listItem><para><codeInline>RENDERDOC_CaptureOption opt</codeInline> specifies which capture option should be retrieved.</para></listItem>
</list>
<para><codeInline>GetCaptureOptionF32()</codeInline></para>
<list class="bullet">
<listItem><para><codeInline>RENDERDOC_CaptureOption opt</codeInline> specifies which capture option should be retrieved.</para></listItem>
</list>
</content>
</section>
<section>
<title>Notes</title>
<content>
<para>See above in above in <link xlink:href="b32454b2-9dff-41e3-8d56-a9607702e51c#SetCaptureOption">SetCaptureOption</link> for the valid values of <codeInline>RENDERDOC_CaptureOption</codeInline>.</para>
</content>
</section>
<section>
<title>Return Value</title>
<content>
<para>The function returns the value of the capture option, if the option is a valid <codeInline>RENDERDOC_CaptureOption</codeInline> enum.</para>
<para><codeInline>GetCaptureOptionU32</codeInline> returns <codeInline>0xffffffff</codeInline> if the option is not a <codeInline>RENDERDOC_CaptureOption</codeInline> enum.</para>
<para><codeInline>GetCaptureOptionF32</codeInline> returns <codeInline>-FLT_MAX</codeInline> if the option is not a <codeInline>RENDERDOC_CaptureOption</codeInline> enum.</para>
</content>
</section>
</sections>
</section>
<section address="SetFocusToggleKeys">
<title>SetFocusToggleKeys</title>
<content>
<para><codeInline>void SetFocusToggleKeys(RENDERDOC_InputButton *keys, int num);</codeInline></para>
<para>
This function changes the key bindings in-application for changing the focussed window.
</para>
</content>
<sections>
<section>
<title>Parameters</title>
<content>
<para><codeInline>SetFocusToggleKeys()</codeInline></para>
<list class="bullet">
<listItem><para><codeInline>RENDERDOC_InputButton *keys</codeInline> lists the keys to bind. If this parameter is NULL, <codeInline>num</codeInline> must be 0.</para></listItem>
<listItem><para><codeInline>int num</codeInline> specifies the number of keys in the <codeInline>keys</codeInline> array. If 0, the keybinding is disabled.</para></listItem>
</list>
</content>
</section>
<section>
<title>Notes</title>
<content>
<para><codeInline>RENDERDOC_InputButton</codeInline> can take one of the following values:</para>
<list class="bullet">
<listItem><para><codeInline>eRENDERDOC_Key_0 .. eRENDERDOC_Key_9</codeInline> are the number keys. The values of these match ASCII for '0' .. '9'.</para></listItem>
<listItem><para><codeInline>eRENDERDOC_Key_A .. eRENDERDOC_Key_Z</codeInline> are the letter keys. The values of these match ASCII for 'A' .. 'Z'.</para></listItem>
<listItem><para><codeInline>eRENDERDOC_Key_Divide</codeInline> is the Divide key.</para></listItem>
<listItem><para><codeInline>eRENDERDOC_Key_Multiply</codeInline> is the Multiply key.</para></listItem>
<listItem><para><codeInline>eRENDERDOC_Key_Subtract</codeInline> is the Subtract key.</para></listItem>
<listItem><para><codeInline>eRENDERDOC_Key_Plus</codeInline> is the Plus key.</para></listItem>
<listItem><para><codeInline>eRENDERDOC_Key_F1 .. eRENDERDOC_Key_F12</codeInline> are the function keys.</para></listItem>
<listItem><para><codeInline>eRENDERDOC_Key_Home</codeInline> is the Home key.</para></listItem>
<listItem><para><codeInline>eRENDERDOC_Key_End</codeInline> is the End key.</para></listItem>
<listItem><para><codeInline>eRENDERDOC_Key_Insert</codeInline> is the Insert key.</para></listItem>
<listItem><para><codeInline>eRENDERDOC_Key_Delete</codeInline> is the Delete key.</para></listItem>
<listItem><para><codeInline>eRENDERDOC_Key_PageUp</codeInline> is the PageUp key.</para></listItem>
<listItem><para><codeInline>eRENDERDOC_Key_PageDn</codeInline> is the PageDn key.</para></listItem>
<listItem><para><codeInline>eRENDERDOC_Key_Backspace</codeInline> is the Backspace key.</para></listItem>
<listItem><para><codeInline>eRENDERDOC_Key_Tab</codeInline> is the Tab key.</para></listItem>
<listItem><para><codeInline>eRENDERDOC_Key_PrtScrn</codeInline> is the PrtScrn key.</para></listItem>
<listItem><para><codeInline>eRENDERDOC_Key_Pause</codeInline> is the Pause key.</para></listItem>
</list>
</content>
</section>
<section>
<title>Return Value</title>
<content>
<para>None</para>
</content>
</section>
</sections>
</section>
<section address="SetFocusToggleKeys">
<title>SetFocusToggleKeys</title>
<content>
<para><codeInline>void SetCaptureKeys(RENDERDOC_InputButton *keys, int num);</codeInline></para>
<para>
This function changes the key bindings in-application for triggering a capture on the current window.
</para>
</content>
<sections>
<section>
<title>Parameters</title>
<content>
<para><codeInline>SetCaptureKeys()</codeInline></para>
<list class="bullet">
<listItem><para><codeInline>RENDERDOC_InputButton *keys</codeInline> lists the keys to bind. If this parameter is NULL, <codeInline>num</codeInline> must be 0.</para></listItem>
<listItem><para><codeInline>int num</codeInline> specifies the number of keys in the <codeInline>keys</codeInline> array. If 0, the keybinding is disabled.</para></listItem>
</list>
</content>
</section>
<section>
<title>Notes</title>
<content>
<para>See above in above in <link xlink:href="b32454b2-9dff-41e3-8d56-a9607702e51c#SetFocusToggleKeys">SetFocusToggleKeys</link> for the valid values of <codeInline>RENDERDOC_InputButton</codeInline>.</para>
</content>
</section>
<section>
<title>Return Value</title>
<content>
<para>None</para>
</content>
</section>
</sections>
</section>
<section address="GetOverlayBits">
<title>GetOverlayBits</title>
<content>
<para><codeInline>uint32_t GetOverlayBits();</codeInline></para>
<para>
This function returns the current mask which determines what sections of the overlay render on each window.
</para>
</content>
<sections>
<section>
<title>Parameters</title>
<content>
<list class="bullet">
<listItem><para>None</para></listItem>
</list>
</content>
</section>
<section>
<title>Notes</title>
<content>
<para>The mask can contain some subset of bits from <codeInline>RENDERDOC_OverlayBits</codeInline>:</para>
<list class="bullet">
<listItem><para><codeInline>eRENDERDOC_Overlay_Enabled</codeInline> is an overall enable/disable bit. If this is disabled, no overlay renders.</para></listItem>
<listItem><para><codeInline>eRENDERDOC_Overlay_FrameRate</codeInline> shows the average, min and max frame time in milliseconds, and the average framerate.</para></listItem>
<listItem><para><codeInline>eRENDERDOC_Overlay_FrameNumber</codeInline> shows the current frame number, as counted by the number of presents.</para></listItem>
<listItem><para><codeInline>eRENDERDOC_Overlay_CaptureList</codeInline> shows how many total captures have been made, and a list of captured frames in the last few seconds.</para></listItem>
<listItem><para><codeInline>eRENDERDOC_Key_F1 .. eRENDERDOC_Key_F12</codeInline> are the function keys.</para></listItem>
<listItem><para><codeInline>eRENDERDOC_Overlay_Default</codeInline> is the default set of bits, which is the value of the mask at startup.</para></listItem>
<listItem><para><codeInline>eRENDERDOC_Overlay_All</codeInline> is equal to <codeInline>~0U</codeInline> so all bits are enabled.</para></listItem>
<listItem><para><codeInline>eRENDERDOC_Overlay_None</codeInline> is equal to <codeInline>0</codeInline> so all bits are disabled.</para></listItem>
</list>
</content>
</section>
<section>
<title>Return Value</title>
<content>
<para>This function returns the current <codeInline>RENDERDOC_OverlayBits</codeInline> mask.</para>
</content>
</section>
</sections>
</section>
<section address="MaskOverlayBits">
<title>MaskOverlayBits</title>
<content>
<para><codeInline>void MaskOverlayBits(uint32_t And, uint32_t Or);</codeInline></para>
<para>
This function modifies the current mask which determines what sections of the overlay render on each window.
</para>
</content>
<sections>
<section>
<title>Parameters</title>
<content>
<para><codeInline>MaskOverlayBits()</codeInline></para>
<list class="bullet">
<listItem><para><codeInline>uint32_t And</codeInline> is a 32-bit value the mask is binary-AND'd with before processing <codeInline>Or</codeInline>.</para></listItem>
<listItem><para><codeInline>uint32_t Or</codeInline> is a 32-bit value the mask is binary-OR'd with after processing <codeInline>And</codeInline>.</para></listItem>
</list>
</content>
</section>
<section>
<title>Notes</title>
<content>
<para>See above in above in <link xlink:href="b32454b2-9dff-41e3-8d56-a9607702e51c#GetOverlayBits">GetOverlayBits</link> for the bits in the mask.</para>
</content>
</section>
<section>
<title>Return Value</title>
<content>
<para>None</para>
</content>
</section>
</sections>
</section>
<section address="Shutdown">
<title>Shutdown</title>
<content>
<para><codeInline>void Shutdown();</codeInline></para>
<para>
This function will attempt to shut down and remove RenderDoc and its hooks from the target process. It must be called as early as
possible in the process, and will have undefined results if any graphics API functions have been called.
</para>
</content>
<sections>
<section>
<title>Parameters</title>
<content>
<list class="bullet">
<listItem><para>None</para></listItem>
</list>
</content>
</section>
<section>
<title>Return Value</title>
<content>
<para>None</para>
</content>
</section>
</sections>
</section>
<section address="UnloadCrashHandler">
<title>UnloadCrashHandler</title>
<content>
<para><codeInline>void UnloadCrashHandler();</codeInline></para>
<para>
This function will remove RenderDoc's crash handler from the target process. If you have your own crash handler
that you want to handle any exceptions, RenderDoc's handler could interfere so it can be disabled.
</para>
</content>
<sections>
<section>
<title>Parameters</title>
<content>
<list class="bullet">
<listItem><para>None</para></listItem>
</list>
</content>
</section>
<section>
<title>Return Value</title>
<content>
<para>None</para>
</content>
</section>
</sections>
</section>
<section address="SetLogFilePathTemplate">
<title>SetLogFilePathTemplate and GetLogFilePathTemplate</title>
<content>
<para><codeInline>void SetLogFilePathTemplate(const char *pathtemplate);</codeInline></para>
<para><codeInline>const char *GetLogFilePathTemplate();</codeInline></para>
<para>
This pair of functions controls the template for where new captures will be saved. The template can
either be a relative or absolute path, which determines where captures will be saved and how they will
be named.
</para>
<para>
If the path template is <codeInline>my_captures/example</codeInline> then captures saved will be e.g.
<codeInline>my_captures/example_frame123.rdc</codeInline> and <codeInline>my_captures/example_frame456.rdc</codeInline>.
Relative paths will be saved relative to the process's current working directory.
</para>
<para>
The default template is in a folder controlled by the UI - initially the system temporary folder, and
the filename is the executable's filename.
</para>
</content>
<sections>
<section>
<title>Parameters</title>
<content>
<para><codeInline>SetLogFilePathTemplate()</codeInline></para>
<list class="bullet">
<listItem><para><codeInline>const char *pathtemplate</codeInline> specifies the capture path template to set, as UTF-8 null-terminated string.</para></listItem>
</list>
<para><codeInline>GetLogFilePathTemplate()</codeInline></para>
<para>
<list class="bullet">
<listItem><para>None</para></listItem>
</list>
</para>
</content>
</section>
<section>
<title>Return Value</title>
<content>
<para><codeInline>SetLogFilePathTemplate()</codeInline> does not return any value.</para>
<para><codeInline>GetLogFilePathTemplate()</codeInline> returns the current capture path template as a UTF-8 null-terminated string.</para>
</content>
</section>
</sections>
</section>
<section address="GetNumCaptures">
<title>GetNumCaptures</title>
<content>
<para><codeInline>uint32_t GetNumCaptures();</codeInline></para>
<para>
This function returns the number of frame captures that have been made.
</para>
</content>
<sections>
<section>
<title>Parameters</title>
<content>
<list class="bullet">
<listItem><para>None</para></listItem>
</list>
</content>
</section>
<section>
<title>Return Value</title>
<content>
<para>Returns the number of frame captures that have been made</para>
</content>
</section>
</sections>
</section>
<section address="GetCapture">
<title>GetCapture</title>
<content>
<para><codeInline>uint32_t GetCapture(uint32_t idx, char *logfile, uint32_t *pathlength, uint64_t *timestamp);</codeInline></para>
<para>
This function returns the details of a particular frame capture, as specified by an
index from 0 to <link xlink:href="b32454b2-9dff-41e3-8d56-a9607702e51c#GetNumCaptures">GetNumCaptures()</link>-1.
</para>
</content>
<sections>
<section>
<title>Parameters</title>
<content>
<para><codeInline>GetCapture()</codeInline></para>
<list class="bullet">
<listItem><para><codeInline>uint32_t idx</codeInline> specifies which capture to return the details of. Must be less than the return value of <link xlink:href="b32454b2-9dff-41e3-8d56-a9607702e51c#GetNumCaptures">GetNumCaptures()</link>.</para></listItem>
<listItem><para><codeInline>char *logfile</codeInline> is an optional parameter filled with the UTF-8 null-terminated path to the file. There must be enough space in the array to contain all characters including the null terminator. If set to NULL, nothing is written.</para></listItem>
<listItem><para><codeInline>uint32_t *pathlength</codeInline> is an optional parameter filled with the byte length of the above <codeInline>logfile</codeInline> including the null-terminator. If set to NULL, nothing is written.</para></listItem>
<listItem><para><codeInline>uint64_t *timestamp</codeInline> is an optional parameter filled with the 64-bit timestamp of the file - equivalent to the <codeInline>time()</codeInline> system call. If set to NULL, nothing is written.</para></listItem>
</list>
</content>
</section>
<section>
<title>Notes</title>
<content>
<para>
It is advised to call this function twice - first to obtain <codeInline>pathlength</codeInline> so that sufficient space
can be allocated. Then again to actually retrieve the path.
</para>
<para>
The path follows the template set in <link xlink:href="b32454b2-9dff-41e3-8d56-a9607702e51c#SetLogFilePathTemplate">SetLogFilePathTemplate()</link> so
it may not be an absolute path.
</para>
</content>
</section>
<section>
<title>Return Value</title>
<content>
<para>Returns <codeInline>1</codeInline> if the capture index was valid, or <codeInline>0</codeInline> if it was out of range.</para>
</content>
</section>
</sections>
</section>
<section address="TriggerCapture">
<title>TriggerCapture</title>
<content>
<para><codeInline>void TriggerCapture();</codeInline></para>
<para>
This function will trigger a capture as if the user had pressed one of the capture hotkeys.
The capture will be taken from the next frame presented to whichever window is considered current.
</para>
</content>
<sections>
<section>
<title>Parameters</title>
<content>
<list class="bullet">
<listItem><para>None</para></listItem>
</list>
</content>
</section>
<section>
<title>Return Value</title>
<content>
<para>None</para>
</content>
</section>
</sections>
</section>
<section address="IsRemoteAccessConnected">
<title>IsRemoteAccessConnected</title>
<content>
<para><codeInline>uint32_t IsRemoteAccessConnected();</codeInline></para>
<para>
This function returns a value to indicate whether the RenderDoc UI is currently connected to
the current process.
</para>
</content>
<sections>
<section>
<title>Parameters</title>
<content>
<list class="bullet">
<listItem><para>None</para></listItem>
</list>
</content>
</section>
<section>
<title>Return Value</title>
<content>
<para>Returns <codeInline>1</codeInline> if the RenderDoc UI is currently connected, or <codeInline>0</codeInline> otherwise.</para>
</content>
</section>
</sections>
</section>
<section address="LaunchReplayUI">
<title>LaunchReplayUI</title>
<content>
<para><codeInline>uint32_t LaunchReplayUI(uint32_t connectRemoteAccess, const char *cmdline);</codeInline></para>
<para>
This function will determine the closest matching replay UI executable for the current RenderDoc module and launch it.
</para>
</content>
<sections>
<section>
<title>Parameters</title>
<content>
<para><codeInline>LaunchReplayUI()</codeInline></para>
<list class="bullet">
<listItem><para><codeInline>uint32_t connectRemoteAccess</codeInline> should be set to 1 if the UI should immediately connect to the application.</para></listItem>
<listItem><para><codeInline>const char *cmdline</codeInline> is an optional UTF-8 null-terminated string to be appended to the command line, e.g. a capture filename. If this parameter is NULL, the command line will be unmodified.</para></listItem>
</list>
</content>
</section>
<section>
<title>Return Value</title>
<content>
<para>If the UI was successfully launched, this function will return the PID of the new process. Otherwise it will return <codeInline>0</codeInline>.</para>
</content>
</section>
</sections>
</section>
<section address="SetActiveWindow">
<title>SetActiveWindow</title>
<content>
<para><codeInline>void SetActiveWindow(RENDERDOC_DevicePointer device, RENDERDOC_WindowHandle wndHandle);</codeInline></para>
<para>
This function will explicitly set which window is considered active. The active window is the one that will be captured
when the keybind to trigger a capture is pressed.
</para>
</content>
<sections>
<section>
<title>Parameters</title>
<content>
<para><codeInline>SetActiveWindow()</codeInline></para>
<list class="bullet">
<listItem><para><codeInline>RENDERDOC_DevicePointer device</codeInline> is a handle to the API 'device' object that will be set active. Must be valid.</para></listItem>
<listItem><para><codeInline>RENDERDOC_WindowHandle wndHandle</codeInline> is a handle to the platform window handle that will be set active. Must be valid.</para></listItem>
</list>
</content>
</section>
<section>
<title>Notes</title>
<content>
<para>
<codeInline>RENDERDOC_DevicePointer</codeInline> is a typedef to <codeInline>void *</codeInline>. The contents of it are API specific:
<list class="bullet">
<listItem><para>For D3D11 it must be the <codeInline>ID3D11Device</codeInline> device object.</para></listItem>
<listItem><para>For OpenGL it must be the <codeInline>HGLRC</codeInline> or <codeInline>GLXContext</codeInline> context object.</para></listItem>
<listItem><para>For Vulkan it must be the dispatch table pointer within the <codeInline>VkInstance</codeInline>. This is a pointer-sized value at the location pointed to by the <codeInline>VkInstance</codeInline>. NOTE - this is not the actual <codeInline>VkInstance</codeInline> pointer itself.</para></listItem>
</list>
</para>
<para>
<codeInline>RENDERDOC_WindowHandle</codeInline> is a typedef to <codeInline>void *</codeInline>. It is the platform specific <codeInline>HWND</codeInline>, <codeInline>xcb_window_t</codeInline>, or Xlib <codeInline>Window</codeInline>.
</para>
</content>
</section>
<section>
<title>Return Value</title>
<content>
<para>None</para>
</content>
</section>
</sections>
</section>
<section address="StartFrameCapture">
<title>StartFrameCapture</title>
<content>
<para><codeInline>void StartFrameCapture(RENDERDOC_DevicePointer device, RENDERDOC_WindowHandle wndHandle);</codeInline></para>
<para>
This function will immediately begin a capture for the specified device/window combination.
</para>
</content>
<sections>
<section>
<title>Parameters</title>
<content>
<para><codeInline>StartFrameCapture()</codeInline></para>
<list class="bullet">
<listItem><para><codeInline>RENDERDOC_DevicePointer device</codeInline> is a handle to the API 'device' object that will be set active. May be NULL to wildcard match.</para></listItem>
<listItem><para><codeInline>RENDERDOC_WindowHandle wndHandle</codeInline> is a handle to the platform window handle that will be set active. May be NULL to wildcard match.</para></listItem>
</list>
</content>
</section>
<section>
<title>Notes</title>
<content>
<para>
<codeInline>RENDERDOC_DevicePointer</codeInline> and <codeInline>RENDERDOC_WindowHandle</codeInline> are described above in <link xlink:href="b32454b2-9dff-41e3-8d56-a9607702e51c#SetActiveWindow">SetActiveWindow()</link>.
</para>
<para>
<codeInline>device</codeInline> and <codeInline>wndHandle</codeInline> can either or both be set to NULL to wildcard match
against active device/window combinations. This wildcard matching can be used if the handle is difficult to obtain where
frame captures are triggered.
</para>
<para>
For example if <codeInline>device</codeInline> is NULL but <codeInline>wndHandle</codeInline> is set, RenderDoc will begin
a capture on the first API it finds that is active on that window.
</para>
<para>
If the wildcard match has multiple possible candidates, it is not defined which will be chosen. Wildcard matching should only
be used when e.g. it is known that only one API is active on a window, or there is only one window active for a given API.
</para>
<para>
If no window has been created and all rendering is off-screen, NULL can be specified for the window handle and the device
object can be passed to select that API. If both are set to NULL, RenderDoc will simply choose one at random so is only
recommended for the case where only one is present.
</para>
</content>
</section>
<section>
<title>Return Value</title>
<content>
<para>None</para>
</content>
</section>
</sections>
</section>
<section address="IsFrameCapturing">
<title>IsFrameCapturing</title>
<content>
<para><codeInline>uint32_t IsFrameCapturing();</codeInline></para>
<para>
This function returns a value to indicate whether the current frame is capturing.
</para>
</content>
<sections>
<section>
<title>Parameters</title>
<content>
<list class="bullet">
<listItem><para>None</para></listItem>
</list>
</content>
</section>
<section>
<title>Return Value</title>
<content>
<para>Returns <codeInline>1</codeInline> if the frame is currently capturing, or <codeInline>0</codeInline> otherwise.</para>
</content>
</section>
</sections>
</section>
<section address="EndFrameCapture">
<title>EndFrameCapture</title>
<content>
<para><codeInline>void EndFrameCapture(RENDERDOC_DevicePointer device, RENDERDOC_WindowHandle wndHandle);</codeInline></para>
<para>
This function will immediately end an active capture for the specified device/window combination.
</para>
</content>
<sections>
<section>
<title>Parameters</title>
<content>
<para><codeInline>EndFrameCapture()</codeInline></para>
<list class="bullet">
<listItem><para><codeInline>RENDERDOC_DevicePointer device</codeInline> is a handle to the API 'device' object that will be set active. May be NULL to wildcard match.</para></listItem>
<listItem><para><codeInline>RENDERDOC_WindowHandle wndHandle</codeInline> is a handle to the platform window handle that will be set active. May be NULL to wildcard match.</para></listItem>
</list>
</content>
</section>
<section>
<title>Notes</title>
<content>
<para>
<codeInline>RENDERDOC_DevicePointer</codeInline> and <codeInline>RENDERDOC_WindowHandle</codeInline> are described above in <link xlink:href="b32454b2-9dff-41e3-8d56-a9607702e51c#SetActiveWindow">SetActiveWindow()</link>.
</para>
<para>
Wildcard matching of <codeInline>device</codeInline> and <codeInline>wndHandle</codeInline> is described above in <link xlink:href="b32454b2-9dff-41e3-8d56-a9607702e51c#BeginFrameCapture">BeginFrameCapture()</link>.
</para>
<para>
There will be undefined results if there is not an active frame capture for the device/window combination.
</para>
</content>
</section>
<section>
<title>Return Value</title>
<content>
<para>None</para>
</content>
</section>
</sections>
</section>
</developerConceptualDocument>
</topic>
+9 -1
View File
@@ -38,6 +38,14 @@
<HelpKeyword index="K" term="Image Viewer" />
</HelpKeywords>
</Topic>
<Topic id="b32454b2-9dff-41e3-8d56-a9607702e51c" visible="True" isSelected="true" title="In-application API">
<HelpKeywords>
<HelpKeyword index="K" term="API" />
<HelpKeyword index="K" term="Manual Capturing" />
<HelpKeyword index="K" term="Manual Capture" />
<HelpKeyword index="K" term="Interface" />
</HelpKeywords>
</Topic>
</Topic>
<Topic id="5c7ad9b1-1fcb-4880-a7f2-5cf6e7b874c1" visible="True" noFile="true" isExpanded="true" title="Behind the Scenes">
<Topic id="632271c3-3d72-4360-b4a0-dc570fcd541e" visible="True" title="Planned Future Features">
@@ -50,7 +58,7 @@
<HelpKeyword index="K" term="RenderDoc Internals" />
</HelpKeywords>
</Topic>
<Topic id="11ea4311-b9ea-450a-8c80-b510ffc8b1a6" visible="True" isSelected="true" title="OpenGL Support">
<Topic id="11ea4311-b9ea-450a-8c80-b510ffc8b1a6" visible="True" title="OpenGL Support">
<HelpKeywords>
<HelpKeyword index="K" term="OpenGL" />
<HelpKeyword index="K" term="OpenGL Support" />
+2 -2
View File
@@ -46,7 +46,7 @@
<listItem><para>You can double click on a thumbnail in the texture viewer to open a
<link xlink:href="32C47E20-0FA2-4F52-B33A-4440EBCCBCE4">locked texture</link> tab</para></listItem>
<listItem><para>You can close tabs by middle clicking on them.</para></listItem>
<listItem><para>You can trigger a capture from code. renderdoc.dll exports an API for this
<listItem><para>You can trigger a capture from code. renderdoc.dll exports an <link xlink:href="b32454b2-9dff-41e3-8d56-a9607702e51c">in-application API</link> for this
purpose, defined in renderdoc_app.h in the distributions:
<code language="cpp">
#include "renderdoc_app.h"
@@ -76,7 +76,7 @@ if(rdoc_api) rdoc_api->TriggerCapture();
<listItem><para>To get API debug or error messages, enable "Create Debug Device" when capturing
then check out the <link xlink:href="1f098896-0e60-485a-b879-900a4a320b80" /> window.</para></listItem>
<listItem><para>Detecting RenderDoc from your code can either be done by trying to load and
use the renderdoc in-program API, or through API specific ways:
use the renderdoc <link xlink:href="b32454b2-9dff-41e3-8d56-a9607702e51c">in-application API</link>, or through API specific ways:
<code language="cpp">
// For D3D11:
ID3D11Device *devicePointer = ...;
+1
View File
@@ -84,6 +84,7 @@
<ResourceItems Include="Resources.items" />
</ItemGroup>
<ItemGroup>
<None Include="API.aml" />
<None Include="Vulkan.aml" />
<None Include="Windows\PythonShell.aml" />
<None Include="OpenGL.aml" />