mirror of
https://github.com/emilk/egui.git
synced 2026-08-30 05:10:03 -04:00
Now App::update will be responsabile for what viewport will be drawned and its content
A big refactoring was needed
This commit is contained in:
@@ -19,7 +19,16 @@ struct Content {
|
||||
}
|
||||
|
||||
impl eframe::App for Content {
|
||||
fn update(&mut self, ctx: &egui::Context, _frame: &mut eframe::Frame) {
|
||||
fn update(
|
||||
&mut self,
|
||||
ctx: &egui::Context,
|
||||
frame: &mut eframe::Frame,
|
||||
render: Option<&ViewportRender>,
|
||||
) {
|
||||
if let Some(render) = render {
|
||||
render(ctx, frame.viewport_id(), frame.parent_viewport_id());
|
||||
return;
|
||||
}
|
||||
egui::CentralPanel::default().show(ctx, |ui| {
|
||||
ui.heading("Press/Hold/Release example. Press A to test.");
|
||||
if ui.button("Clear").clicked() {
|
||||
|
||||
Reference in New Issue
Block a user