mirror of
https://github.com/bevyengine/bevy
synced 2024-11-21 20:23:28 +00:00
Add docs for how to manually add a WinitPlugin
to a MinimalPlugins
setup. (#15989)
# Objective Adding a `WinitPlugin` to a `MinimalPlugins` setup is a bit tricky and confusing due to having a terrible error message and no examples in the repo. ## Solution Document what you need to add.
This commit is contained in:
parent
74dedb2841
commit
8f31c09e60
1 changed files with 3 additions and 0 deletions
|
@ -59,6 +59,9 @@ mod winit_windows;
|
||||||
///
|
///
|
||||||
/// The `T` event type can be used to pass custom events to the `winit`'s loop, and handled as events
|
/// The `T` event type can be used to pass custom events to the `winit`'s loop, and handled as events
|
||||||
/// in systems.
|
/// in systems.
|
||||||
|
///
|
||||||
|
/// When using eg. `MinimalPlugins` you can add this using `WinitPlugin::<WakeUp>::default()`, where
|
||||||
|
/// `WakeUp` is the default `Event` that bevy uses.
|
||||||
#[derive(Default)]
|
#[derive(Default)]
|
||||||
pub struct WinitPlugin<T: Event = WakeUp> {
|
pub struct WinitPlugin<T: Event = WakeUp> {
|
||||||
/// Allows the window (and the event loop) to be created on any thread
|
/// Allows the window (and the event loop) to be created on any thread
|
||||||
|
|
Loading…
Reference in a new issue