Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions framework_crates/bones_bevy_renderer/src/render.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ pub fn sync_bones_window(mut game: ResMut<BonesGame>, mut window_query: Query<&m
game.insert_shared_resource(bones::Window {
size: vec2(window.width(), window.height()),
fullscreen: matches!(&window.mode, WindowMode::BorderlessFullscreen),
focused: window.focused,
});
game.shared_resource_cell().unwrap()
}
Expand All @@ -126,6 +127,7 @@ pub fn sync_bones_window(mut game: ResMut<BonesGame>, mut window_query: Query<&m
WindowMode::Windowed
};
}
bones_window.focused = window.focused;
bones_window.size = vec2(window.width(), window.height());
}

Expand Down
5 changes: 5 additions & 0 deletions framework_crates/bones_framework/src/input/window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,9 @@ pub struct Window {
pub size: glam::Vec2,
/// May be set to change whether or not the game is displayed full-screen.
pub fullscreen: bool,
/// Whether or not the window is focused.
///
/// This is considered read-only and is updated from the window focus by the
/// rendering integration.
pub focused: bool,
}