Skip to content

Commit 48556b7

Browse files
SludgePhDmockersf
authored andcommitted
Make WinitMonitors public (#21786)
# Objective - Allow third-party code to integrate with winit `MonitorHandle`s represented by bevy `Monitor` entities. ## Solution - Reexport this resource type, just like `WinitWindows`. - It was already part of the public API through the system types.
1 parent 8e05017 commit 48556b7

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

crates/bevy_winit/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,12 @@ pub use winit::{
3535
window::{CustomCursor as WinitCustomCursor, CustomCursorSource},
3636
};
3737
pub use winit_config::*;
38+
pub use winit_monitors::*;
3839
pub use winit_windows::*;
3940

4041
use crate::{
4142
accessibility::{AccessKitPlugin, WinitActionRequestHandlers},
4243
state::winit_runner,
43-
winit_monitors::WinitMonitors,
4444
};
4545

4646
pub mod accessibility;

crates/bevy_winit/src/winit_monitors.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,12 @@ pub struct WinitMonitors {
2121
}
2222

2323
impl WinitMonitors {
24+
/// Gets the [`MonitorHandle`] at index `n`.
2425
pub fn nth(&self, n: usize) -> Option<MonitorHandle> {
2526
self.monitors.get(n).map(|(monitor, _)| monitor.clone())
2627
}
2728

29+
/// Gets the [`MonitorHandle`] associated with a `Monitor` entity.
2830
pub fn find_entity(&self, entity: Entity) -> Option<MonitorHandle> {
2931
self.monitors
3032
.iter()

0 commit comments

Comments
 (0)