4 个版本 (破坏性更新)
使用旧的 Rust 2015
0.7.0 | 2019 年 8 月 23 日 |
---|---|
0.6.0 | 2019 年 5 月 19 日 |
0.5.0 | 2019 年 5 月 18 日 |
0.4.0 | 2018 年 9 月 16 日 |
#5 in #renderdoc
每月 33 次下载
7KB
70 行
renderdoc-rs
Rust 绑定到 RenderDoc,一个流行的图形调试器。
RenderDoc 是一个免费的、开源的实时图形调试器,提供快速简单的帧捕获和任何使用 Vulkan、Direct3D 11、Direct3D 12、OpenGL 和 OpenGL ES 的应用程序的详细检查。
这些绑定要求目标机器上安装了 RenderDoc,并且 renderdoc.dll
或 librenderdoc.so
可见于您的 $PATH
。
有关如何使用此 API 将您的游戏或渲染器与 RenderDoc 分析器集成的更多详细信息,请参阅 应用程序 API 文档。
示例
use renderdoc::{RenderDoc, V100, V110};
fn main() {
let mut rd: RenderDoc<V110> = RenderDoc::new().expect("Unable to connect");
let (major, minor, patch) = rd.get_api_version();
assert_eq!(major, 1u32);
assert!(minor >= 1u32);
// When a certain key is pressed, trigger a single-frame capture like this.
rd.trigger_capture();
// If you specify version `V110` or newer, you can trigger a multi-frame
// capture like this.
rd.trigger_multi_frame_capture(3);
// Query the details of an existing capture like this.
match rd.get_capture(0) {
Some((path, capture_time)) => println!("ID: 0, Path: {}, Captured: {:?}", path, capture_time),
None => println!("No capture found with ID of 0!"),
}
// Downgrade your effective API version at run-time like this.
let mut rd: RenderDoc<V100> = rd.into();
// Now this line will no longer compile!
// rd.trigger_multi_frame_capture(3);
}
在 examples
目录中提供可工作的示例。
许可证
renderdoc-rs
是免费的开源软件,根据您的选择,可以按照 MIT 许可协议或 Apache 2.0 许可协议进行分发,详情请见MIT 许可协议或Apache 2.0 许可协议。
除非您明确声明,否则根据 Apache-2.0 许可协议定义的任何有意提交并由您包含在作品中的贡献,将根据上述许可协议进行双重许可,不附加任何额外条款或条件。
依赖项
~1.5MB
~35K SLoC