Skip to content

Commit

Permalink
set winit update mode to continuous for examples
Browse files Browse the repository at this point in the history
  • Loading branch information
Bendzae committed Mar 15, 2024
1 parent 6605fe2 commit 06a8646
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 3 deletions.
7 changes: 6 additions & 1 deletion examples/interpolated.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use std::{
time::SystemTime,
};

use bevy::prelude::*;
use bevy::{prelude::*, winit::UpdateMode::Continuous, winit::WinitSettings};
use bevy_replicon::prelude::*;
use bevy_replicon_renet::{
renet::{
Expand All @@ -32,6 +32,11 @@ const MAX_TICK_RATE: u16 = 5;
fn main() {
App::new()
.init_resource::<Cli>() // Parse CLI before creating window.
// Makes the server/client update continuously even while unfocused.
.insert_resource(WinitSettings {
focused_mode: Continuous,
unfocused_mode: Continuous,
})
.add_plugins((
DefaultPlugins,
RepliconPlugins.build().set(ServerPlugin {
Expand Down
7 changes: 6 additions & 1 deletion examples/no_interpolation_or_prediction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use std::{
time::SystemTime,
};

use bevy::prelude::*;
use bevy::{prelude::*, winit::UpdateMode::Continuous, winit::WinitSettings};
use clap::Parser;
use serde::{Deserialize, Serialize};

Expand All @@ -29,6 +29,11 @@ const MAX_TICK_RATE: u16 = 5;
fn main() {
App::new()
.init_resource::<Cli>() // Parse CLI before creating window.
// Makes the server/client update continuously even while unfocused.
.insert_resource(WinitSettings {
focused_mode: Continuous,
unfocused_mode: Continuous,
})
.add_plugins((
DefaultPlugins,
RepliconPlugins.build().set(ServerPlugin {
Expand Down
7 changes: 6 additions & 1 deletion examples/owner_predicted.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use std::{
time::SystemTime,
};

use bevy::prelude::*;
use bevy::{prelude::*, winit::WinitSettings, winit::UpdateMode::Continuous};
use bevy_replicon::{client::ServerEntityTicks, prelude::*};
use bevy_replicon_renet::{
renet::{
Expand All @@ -34,6 +34,11 @@ const MAX_TICK_RATE: u16 = 5;
fn main() {
App::new()
.init_resource::<Cli>() // Parse CLI before creating window.
// Makes the server/client update continuously even while unfocused.
.insert_resource(WinitSettings {
focused_mode: Continuous,
unfocused_mode: Continuous,
})
.add_plugins((
DefaultPlugins,
RepliconPlugins.build().set(ServerPlugin {
Expand Down

0 comments on commit 06a8646

Please sign in to comment.