bevy/crates/bevy_gilrs/src/lib.rs
Carter Anderson be1c317d4e Resolve (most) internal system ambiguities (#1606)
* Adds labels and orderings to systems that need them (uses the new many-to-many labels for InputSystem)
* Removes the Event, PreEvent, Scene, and Ui stages in favor of First, PreUpdate, and PostUpdate (there is more collapsing potential, such as the Asset stages and _maybe_ removing First, but those have more nuance so they should be handled separately)
* Ambiguity detection now prints component conflicts
* Removed broken change filters from flex calculation (which implicitly relied on the z-update system always modifying translation.z). This will require more work to make it behave as expected so i just removed it (and it was already doing this work every frame).
2021-03-10 22:37:02 +00:00

35 lines
1.0 KiB
Rust

mod converter;
mod gilrs_system;
use bevy_app::{AppBuilder, CoreStage, Plugin, StartupStage};
use bevy_ecs::system::IntoExclusiveSystem;
use bevy_utils::tracing::error;
use gilrs::GilrsBuilder;
use gilrs_system::{gilrs_event_startup_system, gilrs_event_system};
#[derive(Default)]
pub struct GilrsPlugin;
impl Plugin for GilrsPlugin {
fn build(&self, app: &mut AppBuilder) {
match GilrsBuilder::new()
.with_default_filters(false)
.set_update_state(false)
.build()
{
Ok(gilrs) => {
app.insert_non_send_resource(gilrs)
.add_startup_system_to_stage(
StartupStage::PreStartup,
gilrs_event_startup_system.exclusive_system(),
)
.add_system_to_stage(
CoreStage::PreUpdate,
gilrs_event_system.exclusive_system(),
);
}
Err(err) => error!("Failed to start Gilrs. {}", err),
}
}
}