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:
@@ -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
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user