1
0
mirror of https://github.com/emilk/egui.git synced 2026-08-30 13:20:05 -04:00

epi/eframe: move options out of trait App into new NativeOptions

This commit is contained in:
Emil Ernerfeldt
2021-05-08 10:14:56 +02:00
parent 5e46bd404c
commit 7374ed9d00
8 changed files with 57 additions and 40 deletions

View File

@@ -3,6 +3,7 @@ All notable changes to the `eframe` crate.
## Unreleased
* Moved options out of `trait App` into new `NativeOptions`.
## 0.11.0 - 2021-04-05

View File

@@ -41,5 +41,6 @@ impl epi::App for MyApp {
}
fn main() {
eframe::run_native(Box::new(MyApp::default()));
let options = eframe::NativeOptions::default();
eframe::run_native(Box::new(MyApp::default()), options);
}

View File

@@ -20,6 +20,9 @@
pub use {egui, epi};
#[cfg(not(target_arch = "wasm32"))]
pub use epi::NativeOptions;
// ----------------------------------------------------------------------------
// When compiling for web
@@ -56,6 +59,6 @@ pub fn start_web(canvas_id: &str, app: Box<dyn epi::App>) -> Result<(), wasm_bin
/// Call from `fn main` like this: `eframe::run_native(Box::new(MyEguiApp::default()))`
#[cfg(not(target_arch = "wasm32"))]
pub fn run_native(app: Box<dyn epi::App>) -> ! {
egui_glium::run(app)
pub fn run_native(app: Box<dyn epi::App>, native_options: epi::NativeOptions) -> ! {
egui_glium::run(app, native_options)
}