mirror of
https://github.com/eliasstepanik/imgui-rs.git
synced 2026-01-11 21:48:36 +00:00
fmt
This commit is contained in:
parent
52898779e1
commit
0784c95f29
@ -19,7 +19,6 @@ fn draw_text_centered(
|
||||
fn main() {
|
||||
let system = support::init(file!());
|
||||
system.main_loop(move |_, ui| {
|
||||
|
||||
// Get access to draw FG and BG draw lists.
|
||||
let bg_draw_list = ui.get_background_draw_list();
|
||||
let fg_draw_list = ui.get_foreground_draw_list();
|
||||
|
||||
@ -79,9 +79,12 @@ pub struct DrawListMut<'ui> {
|
||||
}
|
||||
|
||||
// Lock for each variant of draw list. See https://github.com/imgui-rs/imgui-rs/issues/488
|
||||
static DRAW_LIST_LOADED_WINDOW: std::sync::atomic::AtomicBool = std::sync::atomic::AtomicBool::new(false);
|
||||
static DRAW_LIST_LOADED_BACKGROUND: std::sync::atomic::AtomicBool = std::sync::atomic::AtomicBool::new(false);
|
||||
static DRAW_LIST_LOADED_FOREGROUND: std::sync::atomic::AtomicBool = std::sync::atomic::AtomicBool::new(false);
|
||||
static DRAW_LIST_LOADED_WINDOW: std::sync::atomic::AtomicBool =
|
||||
std::sync::atomic::AtomicBool::new(false);
|
||||
static DRAW_LIST_LOADED_BACKGROUND: std::sync::atomic::AtomicBool =
|
||||
std::sync::atomic::AtomicBool::new(false);
|
||||
static DRAW_LIST_LOADED_FOREGROUND: std::sync::atomic::AtomicBool =
|
||||
std::sync::atomic::AtomicBool::new(false);
|
||||
|
||||
impl<'ui> Drop for DrawListMut<'ui> {
|
||||
fn drop(&mut self) {
|
||||
@ -89,7 +92,8 @@ impl<'ui> Drop for DrawListMut<'ui> {
|
||||
DrawListType::Window => &DRAW_LIST_LOADED_WINDOW,
|
||||
DrawListType::Background => &DRAW_LIST_LOADED_BACKGROUND,
|
||||
DrawListType::Foreground => &DRAW_LIST_LOADED_FOREGROUND,
|
||||
}.store(false, std::sync::atomic::Ordering::Release);
|
||||
}
|
||||
.store(false, std::sync::atomic::Ordering::Release);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user