diff --git a/src/lib.rs b/src/lib.rs index b1a6e79..85dc0b5 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -544,6 +544,11 @@ impl<'ui> Ui<'ui> { pub fn get_window_draw_list(&'ui self) -> WindowDrawList<'ui> { WindowDrawList::new(self) } + + #[must_use] + pub fn get_background_draw_list(&'ui self) -> WindowDrawList<'ui> { + WindowDrawList::new(self).background() + } } /// Condition for applying a setting diff --git a/src/window_draw_list.rs b/src/window_draw_list.rs index d5e28ac..5a0cce4 100644 --- a/src/window_draw_list.rs +++ b/src/window_draw_list.rs @@ -82,6 +82,13 @@ impl<'ui> WindowDrawList<'ui> { } } + pub(crate) fn background(self) -> Self { + Self { + draw_list: unsafe { sys::igGetBackgroundDrawList() }, + _phantom: PhantomData, + } + } + /// Split into *channels_count* drawing channels. /// At the end of the closure, the channels are merged. The objects /// are then drawn in the increasing order of their channel number, and not