Cargo Features

[dependencies]
eframe = { version = "0.30.0", default-features = false, features = ["accesskit", "android-game-activity", "android-native-activity", "default_fonts", "glow", "persistence", "wayland", "web_screen_reader", "wgpu", "x11"] }
default = accesskit, default_fonts, glow, wayland, web_screen_reader, x11

These default features are set whenever eframe is added without default-features = false somewhere in the dependency tree.

Enables winit and fragile-send-sync-non-atomic-wasm of optional egui-wgpu

egui-wgpu:

Make the renderer Sync on wasm, exploiting that by default wasm isn't multithreaded. It may make code easier, expecially when targeting both native and web. On native most wgpu objects are send and sync, on the web they are not (by nature of the WebGPU specification). This is not supported in multithreaded WASM. Thus that usage is guarded against with compiler errors in wgpu.

accesskit default

Enable platform accessibility API implementations through AccessKit.

Enables accesskit of egui and egui-winit

Affects winit_integration::WinitApp.on_accesskit_event

android-game-activity

Allow crates to choose an android-activity backend via Winit

  • It's important that most applications should not have to depend on android-activity directly, and can rely on Winit to pull in a suitable version (unlike most Rust crates, any version conflicts won't link)
  • It's also important that we don't impose an android-activity backend by taking this choice away from applications.

Enable the game-activity backend via egui-winit on Android

Enables android-game-activity of egui-winit

android-native-activity

Enable the native-activity backend via egui-winit on Android

Enables android-native-activity of egui-winit

default_fonts default

If set, egui will use include_bytes! to bundle some fonts. If you plan on specifying your own fonts you may disable this feature.

Enables default_fonts of egui

glow default

Use glow for painting, via egui_glow.

Enables egui_glow, glow, glutin, and glutin-winit

egui_glow:

Optional dependencies

Affects epi::CreationContext.gl, epi::CreationContext.get_proc_address, epi::App.on_exit, epi::NativeOptions.shader_version, epi::WebOptions.webgl_context_option, run::run_glow, epi::EventLoopBuilderHook, epi::WindowBuilderHook, epi::NativeOptions.renderer, epi::NativeOptions.event_loop_builder, epi::NativeOptions.window_builder, epi::Renderer, eframe::run_native, eframe::run_simple_native

persistence = ron, serde

Enable saving app state to disk.

Enables home, persistence of egui, serde of egui-winit

Affects native::file_storage

wayland default

Enables wayland support and fixes clipboard issue.

Enables wayland of optional egui-wgpu, egui-winit, optional egui_glow, optional glutin, and optional glutin-winit

web_screen_reader default

Enable screen reader support (requires ctx.options_mut(|o| o.screen_reader = true);) on web.

For other platforms, use the accesskit feature instead.

Enables SpeechSynthesis and SpeechSynthesisUtterance of web-sys

Affects web::screen_reader

wgpu

Use wgpu for painting (via egui-wgpu).

This overrides the glow feature.

By default, only WebGPU is enabled on web. If you want to enable WebGL, you need to turn on the webgl feature of crate wgpu:

wgpu = { version = "*", features = ["webgpu", "webgl"] }

By default, eframe will prefer WebGPU over WebGL, but you can configure this at run-time with NativeOptions::wgpu_options.

Enables egui-wgpu, pollster, and wgpu

Affects epi::CreationContext.wgpu_render_state, epi::NativeOptions.wgpu_options, epi::WebOptions.wgpu_options, run::run_wgpu, epi::EventLoopBuilderHook, epi::WindowBuilderHook, epi::NativeOptions.renderer, epi::NativeOptions.event_loop_builder, epi::NativeOptions.window_builder, epi::Renderer, eframe::run_native, eframe::run_simple_native

x11 default

Enables compiling for x11.

Enables glx and x11 of optional glutin and optional glutin-winit, x11 of egui-winit, optional egui-wgpu, and optional egui_glow

Features from optional dependencies

In crates that don't use the dep: syntax, optional dependencies automatically become Cargo features. These features may have been created by mistake, and this functionality may be removed in the future.

ron persistence?

Affects epi::get_value, epi::set_value

serde persistence?