Skip to content
Merged
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
18 changes: 16 additions & 2 deletions crates/shards/src/plugins.rs
Original file line number Diff line number Diff line change
Expand Up @@ -270,8 +270,22 @@ impl Plugin for EmbeddedLogCapture {

fn with_window(group: PluginGroupBuilder, config: &EngineConfig) -> PluginGroupBuilder {
let (width, height) = config.window;
let window = Window { title: config.title.clone(), resolution: (width, height).into(), ..default() };
let group = group.set(WindowPlugin { primary_window: Some(window), ..default() });
// The least latency a hand on the mouse can feel, at some of the frame rate: one frame queued on the GPU, not
// Bevy's two, and no pipelined rendering (with it the main world works on the next frame while this one is drawn,
// which is one frame more between a mouse move and the picture). With vsync and both, a look turned 3 to 4 frames
// after the hand moved, which a player felt as smoothing on the mouse.
let window = Window {
title: config.title.clone(),
resolution: (width, height).into(),
desired_maximum_frame_latency: std::num::NonZeroU32::new(1),
..default()
};
#[cfg_attr(not(feature = "render"), allow(unused_mut))]
let mut group = group.set(WindowPlugin { primary_window: Some(window), ..default() });
#[cfg(feature = "render")]
if group.contains::<bevy::render::pipelined_rendering::PipelinedRenderingPlugin>() {
group = group.disable::<bevy::render::pipelined_rendering::PipelinedRenderingPlugin>();
}
// `<assets>/icon.png`, if the game has one, in the title bar and the taskbar; how long frames take.
#[cfg(feature = "render")]
let group = group
Expand Down
Loading