File tree 1 file changed +15
-3
lines changed
1 file changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -33,12 +33,24 @@ pub struct WinitSettings {
33
33
pub unfocused_mode : UpdateMode ,
34
34
}
35
35
impl WinitSettings {
36
- /// Configure winit with common settings for a game.
36
+ /// Default settings for games.
37
+ ///
38
+ /// [`Continuous`](UpdateMode::Continuous) if windows have focus,
39
+ /// [`ReactiveLowPower`](UpdateMode::ReactiveLowPower) otherwise.
37
40
pub fn game ( ) -> Self {
38
- WinitSettings :: default ( )
41
+ WinitSettings {
42
+ focused_mode : UpdateMode :: Continuous ,
43
+ unfocused_mode : UpdateMode :: ReactiveLowPower {
44
+ max_wait : Duration :: from_millis ( 50 ) , // 20Hz
45
+ } ,
46
+ ..Default :: default ( )
47
+ }
39
48
}
40
49
41
- /// Configure winit with common settings for a desktop application.
50
+ /// Default settings for desktop applications.
51
+ ///
52
+ /// [`Reactive`](UpdateMode::Reactive) if windows have focus,
53
+ /// [`ReactiveLowPower`](UpdateMode::ReactiveLowPower) otherwise.
42
54
pub fn desktop_app ( ) -> Self {
43
55
WinitSettings {
44
56
focused_mode : UpdateMode :: Reactive {
You can’t perform that action at this time.
0 commit comments