Skip to main content

repose_app/
app_config.rs

1use repose_core::present_mode::PresentModePref;
2
3/// Options common to all platforms.
4#[derive(Clone, Copy, Debug)]
5pub struct ReposeOptions {
6    pub msaa_samples: u32,
7    pub max_fps: Option<f32>,
8    pub present_mode: PresentModePref,
9}
10
11impl Default for ReposeOptions {
12    fn default() -> Self {
13        Self {
14            msaa_samples: 4,
15            max_fps: None,
16            present_mode: PresentModePref::Auto,
17        }
18    }
19}
20
21/// Configuration for desktop `run_desktop_app`.
22#[derive(Clone, Debug)]
23pub struct AppConfig {
24    pub common: ReposeOptions,
25    pub window_title: String,
26    pub window_size: (u32, u32),
27    pub enable_inspector: bool,
28}
29
30impl Default for AppConfig {
31    fn default() -> Self {
32        Self {
33            common: ReposeOptions::default(),
34            window_title: "Repose".to_string(),
35            window_size: (1280, 800),
36            enable_inspector: true,
37        }
38    }
39}
40
41/// Options for the Android runner.
42#[derive(Clone, Copy, Debug)]
43pub struct AndroidOptions {
44    pub continuous_redraw: bool,
45    pub ime_height_px: Option<f32>,
46    pub common: ReposeOptions,
47}
48
49impl Default for AndroidOptions {
50    fn default() -> Self {
51        Self {
52            continuous_redraw: false,
53            ime_height_px: None,
54            common: ReposeOptions::default(),
55        }
56    }
57}