docs/bevy/examples/app/without_winit.rs 365 B · 14 lines · raw · history
| 1 | //! Create an application without winit (runs single time, no event loop). |
| 2 | |
| 3 | use bevy::{prelude::*, winit::WinitPlugin}; |
| 4 | |
| 5 | fn main() { |
| 6 | App::new() |
| 7 | .add_plugins(DefaultPlugins.build().disable::<WinitPlugin>()) |
| 8 | .add_systems(Update, setup_system) |
| 9 | .run(); |
| 10 | } |
| 11 | |
| 12 | fn setup_system(mut commands: Commands) { |
| 13 | commands.spawn(Camera3d::default()); |
| 14 | } |