dear_imgui_rs/utils/
general.rs1use super::counts::non_negative_count_from_i32;
2use crate::sys;
3
4impl crate::ui::Ui {
5 #[doc(alias = "GetTime")]
7 pub fn time(&self) -> f64 {
8 self.run_with_bound_context(|| unsafe { sys::igGetTime() })
9 }
10
11 #[doc(alias = "GetFrameCount")]
13 pub fn frame_count(&self) -> usize {
14 non_negative_count_from_i32(
15 "Ui::frame_count()",
16 self.run_with_bound_context(|| unsafe { sys::igGetFrameCount() }),
17 )
18 }
19
20 #[doc(alias = "CalcItemWidth")]
22 pub fn calc_item_width(&self) -> f32 {
23 self.run_with_bound_context(|| unsafe { sys::igCalcItemWidth() })
24 }
25}