Expand description
A desktop window: eframe on wgpu, with the renderer set up by gpu and a
CJK font behind egui’s own.
run is the whole of opening an app’s desktop window; open is its lower half, for
an entry that builds its own eframe::NativeOptions. With the android feature,
run_android opens the window on an Android phone. The sapphire apps
and asteria open their windows through here, so a renderer fix reaches all of them.
On iOS, an app built with the iOS 27 SDK must declare a scene in its Info.plist, with
IOS_SCENE_DELEGATE as the scene’s delegate: iOS 27 stops at launch an app that does
not, and winit 0.30 does not put its window in a scene by itself (#37).
UIApplicationSceneManifest:
UIApplicationSupportsMultipleScenes: false
UISceneConfigurations:
UIWindowSceneSessionRoleApplication:
- UISceneConfigurationName: Default
UISceneDelegateClassName: CorundumSceneDelegateuse corundum_framework_gui::{eframe, egui, window};
struct Example;
impl eframe::App for Example {
fn ui(&mut self, ui: &mut egui::Ui, _frame: &mut eframe::Frame) {
ui.label("Hello");
}
}
fn main() -> eframe::Result<()> {
window::run(
window::WindowOptions::new("Example").inner_size([800.0, 500.0]),
|_cc| Box::new(Example),
)
}Structs§
- Window
Options - A desktop window: its title, its size and its fonts.
Constants§
- IOS_
SCENE_ DELEGATE - The class of the scene delegate an iOS app names in its Info.plist’s scene manifest
(
UISceneDelegateClassName). It shows the window once the app’s scene connects.
Functions§
- open
- Run eframe with
nativeas the caller built it, building the app withcreateonce the window exists: reports the renderer (gpu::on_render_state) and installsfonts, or the default ones whenNone.runis this for a desktop window. - run
- Open a desktop window and run it until it closes.
Type Aliases§
- Install
Fonts - Sets the egui context’s fonts, once, before the app is built.