dear_imgui_rs/ui/
debug_tools.rs1use super::*;
2
3impl Ui {
4 #[doc(alias = "ShowDemoWindow")]
7 pub fn show_demo_window(&self, opened: &mut bool) {
8 self.run_with_bound_context(|| unsafe {
9 crate::sys::igShowDemoWindow(opened);
10 });
11 }
12
13 #[doc(alias = "ShowAboutWindow")]
17 pub fn show_about_window(&self, opened: &mut bool) {
18 self.run_with_bound_context(|| unsafe {
19 crate::sys::igShowAboutWindow(opened);
20 });
21 }
22
23 #[doc(alias = "ShowMetricsWindow")]
28 pub fn show_metrics_window(&self, opened: &mut bool) {
29 self.run_with_bound_context(|| unsafe {
30 crate::sys::igShowMetricsWindow(opened);
31 });
32 }
33
34 #[doc(alias = "ShowUserGuide")]
36 pub fn show_user_guide(&self) {
37 self.run_with_bound_context(|| unsafe {
38 crate::sys::igShowUserGuide();
39 });
40 }
41
42 #[doc(alias = "ShowDebugLogWindow")]
50 pub fn show_debug_log_window(&self, opened: &mut bool) {
51 self.run_with_bound_context(|| unsafe {
52 sys::igShowDebugLogWindow(opened);
53 });
54 }
55
56 #[doc(alias = "ShowIDStackToolWindow")]
60 pub fn show_id_stack_tool_window(&self, opened: &mut bool) {
61 self.run_with_bound_context(|| unsafe {
62 sys::igShowIDStackToolWindow(opened);
63 });
64 }
65
66 #[doc(alias = "GetVersion")]
68 pub fn get_version(&self) -> &str {
69 self.run_with_bound_context(|| unsafe {
70 let version_ptr = sys::igGetVersion();
71 if version_ptr.is_null() {
72 return "Unknown";
73 }
74 let c_str = std::ffi::CStr::from_ptr(version_ptr);
75 c_str.to_str().unwrap_or("Unknown")
76 })
77 }
78}