Struct renderdoc::RenderDoc[][src]

#[repr(C)]pub struct RenderDoc<V>(_, _);

An instance of the RenderDoc API with baseline version V.

Implementations

impl<V: Version> RenderDoc<V>[src]

pub fn new() -> Result<Self, Error>[src]

Initializes a new instance of the RenderDoc API.

pub unsafe fn raw_api(&self) -> *mut Entry[src]

Returns the raw entry point of the API.

Safety

Using the entry point structure directly will discard any thread safety provided by default with this library.

pub unsafe fn shutdown(self)[src]

Attempts to shut down RenderDoc.

Safety

Note that this will work correctly if done immediately after the dynamic library is loaded, before any API work happens. At that point, RenderDoc will remove its injected hooks and shut down. Behavior is undefined if this is called after any API functions have been called.

Compatibility

This process is only possible on Windows, and even then it is not well defined so may not be possible in all circumstances. This function is provided at your own risk.

impl<V: HasPrevious> RenderDoc<V>[src]

pub fn downgrade(self) -> RenderDoc<V::Previous>[src]

Downgrades the current API version to the version immediately preceding it.

Examples

let current: RenderDoc<V112> = RenderDoc::new()?;
let previous: RenderDoc<V111> = current.downgrade();
// let older: RenderDoc<V100> = previous.downgrade(); // This line does not compile

impl RenderDoc<V100>[src]

pub fn get_api_version(&self) -> (u32, u32, u32)[src]

Returns the major, minor, and patch version numbers of the RenderDoc API currently in use.

Note that RenderDoc will usually provide a higher API version than the one requested by the user if it's backwards compatible.

Examples

let renderdoc: RenderDoc<V100> = RenderDoc::new()?;
let (major, minor, patch) = renderdoc.get_api_version();
assert_eq!(major, 1);

pub fn set_capture_option_f32(&mut self, opt: CaptureOption, val: f32)[src]

Sets the specified CaptureOption to the given f32 value.

Panics

This method will panic if the option and/or the value are invalid.

pub fn set_capture_option_u32(&mut self, opt: CaptureOption, val: u32)[src]

Sets the specified CaptureOption to the given u32 value.

Panics

This method will panic if the option and/or the value are invalid.

pub fn get_capture_option_f32(&self, opt: CaptureOption) -> f32[src]

Returns the value of the given CaptureOption as an f32 value.

Panics

This method will panic if the option is invalid.

pub fn get_capture_option_u32(&self, opt: CaptureOption) -> u32[src]

Returns the value of the given CaptureOption as a u32 value.

Panics

This method will panic if the option is invalid.

pub fn set_capture_keys<I: Into<InputButton> + Clone>(&mut self, keys: &[I])[src]

Sets the key bindings used in-application to trigger a capture on the current window.

If the keys slice is empty, all existing capture key bindings are disabled.

pub fn set_focus_toggle_keys<I: Into<InputButton> + Clone>(
    &mut self,
    keys: &[I]
)
[src]

Sets the key bindings used in-application to switch focus between windows.

If the keys slice is empty, all existing focus toggle key bindings are disabled.

pub fn unload_crash_handler(&mut self)[src]

Removes RenderDoc's injected crash handler from the current process.

This allows you to provide your own global crash handler with which to handle exceptions, if you so desire. After the crash handler has been removed, subsequent calls to this method will do nothing.

pub fn get_overlay_bits(&self) -> OverlayBits[src]

Returns a bitmask representing which elements of the RenderDoc overlay are being rendered on each window.

pub fn mask_overlay_bits(&mut self, and: OverlayBits, or: OverlayBits)[src]

Applies the given and and or bitflags to determine which elements of the RenderDoc overlay should be rendered on each window.

This method applies and to the current mask with a bitwise-and, and then applies or using a bitwise-or on top.

pub fn get_log_file_path_template(&self) -> &Path[src]

Returns the path template where new captures will be stored.

The template can either be a relative or absolute path, which determines where captures will be saved and how they will be named. Relative paths will be saved relative to the process' current working directory.

By default, this will be in a folder controlled by the UI - initially the system temporary directory, and the filename is the executable's filename.

Examples

let renderdoc: RenderDoc<V100> = RenderDoc::new()?;
println!("{:?}", renderdoc.get_log_file_path_template()); // e.g. `my_captures/example`

pub fn set_log_file_path_template<P: Into<PathBuf>>(&mut self, path_template: P)[src]

Sets the path template where new capture files should be stored.

The template can either be a relative or absolute path, which determines where captures will be saved and how they will be named. Relative paths will be saved relative to the process' current working directory.

The default template is in a folder controlled by the UI - initially the system temporary directory, and the filename is the executable's filename.

Examples

let mut renderdoc: RenderDoc<V100> = RenderDoc::new()?;
renderdoc.set_log_file_path_template("my_captures/example");

renderdoc.trigger_capture(); // Saved as `my_captures/example_frame123.rdc`
renderdoc.trigger_capture(); // Saved as `my_captures/example_frame456.rdc`

pub fn get_num_captures(&self) -> u32[src]

Returns the number of frame captures that have been made.

Examples

let renderdoc: RenderDoc<V100> = RenderDoc::new()?;
assert_eq!(renderdoc.get_num_captures(), 0);

pub fn get_capture(&self, index: u32) -> Option<(PathBuf, SystemTime)>[src]

Retrieves the path and capture time of a capture file indexed by the number index.

Returns Some if the index was within 0..get_num_captures(), otherwise returns None.

Examples

let mut renderdoc: RenderDoc<V100> = RenderDoc::new()?;

// Capture a frame.
renderdoc.trigger_capture();

// Get information about the previous capture.
let (file_path, capture_time) = renderdoc.get_capture(0).unwrap();

pub fn trigger_capture(&mut self)[src]

Captures the next frame from the currently active window and API device.

Data is saved to a capture file at the location specified by set_log_file_path_template().

let mut renderdoc: RenderDoc<V100> = RenderDoc::new()?;

// Capture the current frame and save to a file.
renderdoc.trigger_capture();

pub fn is_remote_access_connected(&self) -> bool[src]

Returns whether the RenderDoc UI is connected to this application.

Examples

let renderdoc: RenderDoc<V100> = RenderDoc::new()?;
assert!(!renderdoc.is_remote_access_connected());

pub fn launch_replay_ui<'a, O>(
    &self,
    connect_immediately: bool,
    extra_opts: O
) -> Result<u32, Error> where
    O: Into<Option<&'a str>>, 
[src]

Launches the replay UI associated with the RenderDoc library injected into the running application.

If connect_immediately is true, the replay window will automatically connect to this application once opened, ready to capture frames right away. Optional command-line arguments to the RenderDoc replay UI can be specified via the extra_opts parameter.

Returns the PID of the RenderDoc replay process on success.

Examples

let renderdoc: RenderDoc<V100> = RenderDoc::new()?;
let pid = renderdoc.launch_replay_ui(true, None)?;

pub fn set_active_window<D>(&mut self, dev: D, win: WindowHandle) where
    D: Into<DevicePointer>, 
[src]

Explicitly set which window is considered "active" by RenderDoc.

The active window is the one that will be captured when the keybinding to trigger a capture is pressed by the user, as well as when trigger_capture() is called.

Both dev and win must be valid handles.

pub fn start_frame_capture<D>(&mut self, dev: D, win: WindowHandle) where
    D: Into<DevicePointer>, 
[src]

Begins a frame capture for the specified device/window combination.

If either or both dev and win are set to std::ptr::null(), then RenderDoc will perform a wildcard match.

For example, you can specify null(), null() for the device to capture on if you have only one device and only one or zero windows, and RenderDoc will capture from that device.

This function must be paired with a matching start_frame_capture() to succeed.

let mut renderdoc: RenderDoc<V100> = RenderDoc::new()?;
renderdoc.start_frame_capture(std::ptr::null(), std::ptr::null());

// Capturing window from here onward...

pub fn is_frame_capturing(&self) -> bool[src]

Returns whether or not a frame capture is currently ongoing anywhere.

Examples

let renderdoc: RenderDoc<V100> = RenderDoc::new()?;
if renderdoc.is_frame_capturing() {
    println!("Frames are being captured.");
} else {
    println!("No frame capture is occurring.");
}

pub fn end_frame_capture<D>(&mut self, dev: D, win: WindowHandle) where
    D: Into<DevicePointer>, 
[src]

Ends a frame capture for the specified device/window combination, saving results to disk.

If either or both dev and win are set to std::ptr::null(), then RenderDoc will perform a wildcard match.

For example, you can specify null(), null() for the device to capture on if you have only one device and only one or zero windows, and RenderDoc will capture from that device.

This function must be paired with a matching end_frame_capture() to complete.

let mut renderdoc: RenderDoc<V100> = RenderDoc::new()?;

renderdoc.start_frame_capture(std::ptr::null(), std::ptr::null());
// Do some rendering here...
renderdoc.end_frame_capture(std::ptr::null(), std::ptr::null());

impl RenderDoc<V110>[src]

pub fn trigger_multi_frame_capture(&mut self, num_frames: u32)[src]

Captures the next n frames from the currently active window and API device.

Data is saved to n separate capture files at the location specified via set_log_file_path_template().

impl RenderDoc<V111>[src]

pub fn is_target_control_connected(&self) -> bool[src]

Returns whether the RenderDoc UI is connected to this application.

Examples

let renderdoc: RenderDoc<V111> = RenderDoc::new()?;
assert!(!renderdoc.is_target_control_connected());

pub fn is_remote_access_connected(&self) -> bool[src]

👎 Deprecated since 1.1.1:

renamed to is_target_control_connected

Returns whether the RenderDoc UI is connected to this application.

impl RenderDoc<V112>[src]

pub fn get_capture_file_path_template(&self) -> &Path[src]

Returns the path template where new captures will be stored.

The template can either be a relative or absolute path, which determines where captures will be saved and how they will be named. Relative paths will be saved relative to the process' current working directory.

By default, this will be in a folder controlled by the UI - initially the system temporary directory, and the filename is the executable's filename.

Examples

let renderdoc: RenderDoc<V112> = RenderDoc::new()?;
println!("{:?}", renderdoc.get_capture_file_path_template()); // e.g. `my_captures/example`

pub fn set_capture_file_path_template<P: Into<PathBuf>>(
    &mut self,
    path_template: P
)
[src]

Sets the path template where new capture files should be stored.

The template can either be a relative or absolute path, which determines where captures will be saved and how they will be named. Relative paths will be saved relative to the process' current working directory.

The default template is in a folder controlled by the UI - initially the system temporary directory, and the filename is the executable's filename.

Examples

let mut renderdoc: RenderDoc<V112> = RenderDoc::new()?;
renderdoc.set_capture_file_path_template("my_captures/example");

renderdoc.trigger_capture(); // Saved as `my_captures/example_frame123.rdc`
renderdoc.trigger_capture(); // Saved as `my_captures/example_frame456.rdc`

pub fn get_log_file_path_template(&self) -> &Path[src]

👎 Deprecated since 1.1.2:

renamed to get_capture_file_path_template

Returns the path template where new captures will be stored.

pub fn set_log_file_path_template<P: Into<PathBuf>>(&mut self, path_template: P)[src]

👎 Deprecated since 1.1.2:

renamed to set_capture_file_path_template

Sets the path template where new capture files should be stored.

impl RenderDoc<V120>[src]

pub fn set_capture_file_comments<'a, P, C>(&mut self, path: P, comments: C) where
    P: Into<Option<&'a str>>,
    C: Into<String>, 
[src]

Adds or sets an arbitrary comments field to an existing capture on disk, which will then be displayed in the UI to anyone opening the capture file.

If the path argument is None, the most recent previous capture file is used.

impl RenderDoc<V140>[src]

pub fn discard_frame_capture<D>(&mut self, dev: D, win: WindowHandle) -> bool where
    D: Into<DevicePointer>, 
[src]

Ends capturing immediately and discards any data without saving to disk.

Returns true if the capture was discarded, or false if no capture is in progress.

Trait Implementations

impl<V: Version> Debug for RenderDoc<V>[src]

impl<V: HasPrevious> DerefMut for RenderDoc<V>[src]

impl<V: Eq> Eq for RenderDoc<V>[src]

impl From<RenderDoc<V110>> for RenderDoc<V100> where
    Self: Sized
[src]

impl From<RenderDoc<V111>> for RenderDoc<V110> where
    Self: Sized
[src]

impl From<RenderDoc<V111>> for RenderDoc<V100> where
    Self: Sized
[src]

impl From<RenderDoc<V112>> for RenderDoc<V111> where
    Self: Sized
[src]

impl From<RenderDoc<V112>> for RenderDoc<V110> where
    Self: Sized
[src]

impl From<RenderDoc<V112>> for RenderDoc<V100> where
    Self: Sized
[src]

impl From<RenderDoc<V120>> for RenderDoc<V112> where
    Self: Sized
[src]

impl From<RenderDoc<V120>> for RenderDoc<V111> where
    Self: Sized
[src]

impl From<RenderDoc<V120>> for RenderDoc<V110> where
    Self: Sized
[src]

impl From<RenderDoc<V120>> for RenderDoc<V100> where
    Self: Sized
[src]

impl From<RenderDoc<V130>> for RenderDoc<V120> where
    Self: Sized
[src]

impl From<RenderDoc<V130>> for RenderDoc<V112> where
    Self: Sized
[src]

impl From<RenderDoc<V130>> for RenderDoc<V111> where
    Self: Sized
[src]

impl From<RenderDoc<V130>> for RenderDoc<V110> where
    Self: Sized
[src]

impl From<RenderDoc<V130>> for RenderDoc<V100> where
    Self: Sized
[src]

impl From<RenderDoc<V140>> for RenderDoc<V130> where
    Self: Sized
[src]

impl From<RenderDoc<V140>> for RenderDoc<V120> where
    Self: Sized
[src]

impl From<RenderDoc<V140>> for RenderDoc<V112> where
    Self: Sized
[src]

impl From<RenderDoc<V140>> for RenderDoc<V111> where
    Self: Sized
[src]

impl From<RenderDoc<V140>> for RenderDoc<V110> where
    Self: Sized
[src]

impl From<RenderDoc<V140>> for RenderDoc<V100> where
    Self: Sized
[src]

impl From<RenderDoc<V141>> for RenderDoc<V140> where
    Self: Sized
[src]

impl From<RenderDoc<V141>> for RenderDoc<V130> where
    Self: Sized
[src]

impl From<RenderDoc<V141>> for RenderDoc<V120> where
    Self: Sized
[src]

impl From<RenderDoc<V141>> for RenderDoc<V112> where
    Self: Sized
[src]

impl From<RenderDoc<V141>> for RenderDoc<V111> where
    Self: Sized
[src]

impl From<RenderDoc<V141>> for RenderDoc<V110> where
    Self: Sized
[src]

impl From<RenderDoc<V141>> for RenderDoc<V100> where
    Self: Sized
[src]

impl<V: Hash> Hash for RenderDoc<V>[src]

impl<V: PartialEq> PartialEq<RenderDoc<V>> for RenderDoc<V>[src]

impl<V> Send for RenderDoc<V>[src]

impl<V> StructuralEq for RenderDoc<V>[src]

impl<V> StructuralPartialEq for RenderDoc<V>[src]

Auto Trait Implementations

impl<V> RefUnwindSafe for RenderDoc<V> where
    V: RefUnwindSafe
[src]

impl<V> !Sync for RenderDoc<V>[src]

impl<V> Unpin for RenderDoc<V> where
    V: Unpin
[src]

impl<V> UnwindSafe for RenderDoc<V> where
    V: UnwindSafe
[src]

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.