Revert "Initialize the egui GUI using the update function"
This reverts commit 5c9ac31408
.
This commit is contained in:
parent
cc3d2bcba0
commit
47b6631283
1 changed files with 3 additions and 7 deletions
|
@ -20,7 +20,7 @@
|
||||||
|
|
||||||
use baseview::{Size, WindowHandle, WindowOpenOptions, WindowScalePolicy};
|
use baseview::{Size, WindowHandle, WindowOpenOptions, WindowScalePolicy};
|
||||||
use egui::CtxRef;
|
use egui::CtxRef;
|
||||||
use egui_baseview::{EguiWindow, RenderSettings, Settings};
|
use egui_baseview::{EguiWindow, Queue, RenderSettings, Settings};
|
||||||
use nih_plug::{Editor, EditorWindowHandle, GuiContext};
|
use nih_plug::{Editor, EditorWindowHandle, GuiContext};
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
|
|
||||||
|
@ -45,12 +45,8 @@ pub fn create_egui_editor<'context, T, U>(
|
||||||
) -> Option<Box<dyn Editor + 'context>>
|
) -> Option<Box<dyn Editor + 'context>>
|
||||||
where
|
where
|
||||||
T: 'static + Send,
|
T: 'static + Send,
|
||||||
U: FnMut(&CtxRef, &dyn GuiContext, &mut T) + 'static + Send + Clone,
|
U: FnMut(&CtxRef, &dyn GuiContext, &mut T) + 'static + Send,
|
||||||
{
|
{
|
||||||
// For convenience we'll make the same closure for the update and the build functions.
|
|
||||||
let mut build = update.clone();
|
|
||||||
let context_build = context.clone();
|
|
||||||
|
|
||||||
// TODO: Also pass the context reference to the update callback
|
// TODO: Also pass the context reference to the update callback
|
||||||
let (width, height) = size.load();
|
let (width, height) = size.load();
|
||||||
let window = EguiWindow::open_parented(
|
let window = EguiWindow::open_parented(
|
||||||
|
@ -81,7 +77,7 @@ where
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
initial_state,
|
initial_state,
|
||||||
move |ctx, _, state| build(ctx, context_build.as_ref(), state),
|
|_, _, _| {},
|
||||||
move |ctx, _, state| update(ctx, context.as_ref(), state),
|
move |ctx, _, state| update(ctx, context.as_ref(), state),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue