blob: 9c3e80d511a0666b7da2d86b876cf35a3be69c88 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
|
const c = @import("c.zig");
var rdoc_api: ?*c.RENDERDOC_API_1_1_2 = null;
pub fn init() void {
const maybe_mod = c.dlopen("librenderdoc.so", c.RTLD_NOW | c.RTLD_NOLOAD);
if (maybe_mod) |mod| {
const getAPI: c.pRENDERDOC_GetAPI = @ptrCast(c.dlsym(mod, "RENDERDOC_GetAPI"));
const ret = getAPI.?(c.eRENDERDOC_API_Version_1_1_2, @ptrCast(&rdoc_api));
if (ret != 1) unreachable;
}
}
pub fn startCapture(glfwWindow: *c.GLFWwindow) void {
_ = glfwWindow;
if (rdoc_api) |api| {
// const window = c.glfwGetWaylandWindow(glfwWindow);
// const context = c.glfwGetEGLContext(glfwWindow);
// api.StartFrameCapture.?(context, window);
_ = api.StartFrameCapture.?(null, null);
}
}
pub fn endCapture(glfwWindow: *c.GLFWwindow) void {
_ = glfwWindow;
if (rdoc_api) |api| {
// const window = c.glfwGetWaylandWindow(glfwWindow);
// const context = c.glfwGetEGLContext(glfwWindow);
// _ = api.EndFrameCapture.?(context, window);
_ = api.StartFrameCapture.?(null, null);
}
}
pub fn discardCapture(glfwWindow: *c.GLFWwindow) void {
_ = glfwWindow;
if (rdoc_api) |api| {
// const window = c.glfwGetWaylandWindow(glfwWindow);
// const context = c.glfwGetEGLContext(glfwWindow);
// _ = api.DiscardFrameCapture.?(context, window);
_ = api.DiscardFrameCapture.?(null, null);
}
}
|