Skip to content

Commit

Permalink
Expose desired_maximum_frame_latency
Browse files Browse the repository at this point in the history
  • Loading branch information
hakolao committed Jan 24, 2024
1 parent 7783def commit c3c645f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ pub struct WindowConfig {
pub present_mode: PresentMode,
pub alpha_mode: CompositeAlphaMode,
pub surface_format: TextureFormat,
pub desired_maximum_frame_latency: u32,
pub max_size: Option<LogicalSize<u32>>,
pub min_size: Option<LogicalSize<u32>>,
pub exit_on_esc: bool,
Expand All @@ -37,6 +38,7 @@ impl Default for WindowConfig {
present_mode: PresentMode::AutoVsync,
alpha_mode: CompositeAlphaMode::Auto,
surface_format: GlassWindow::default_surface_format(),
desired_maximum_frame_latency: 2,
exit_on_esc: false,
max_size: None,
min_size: None,
Expand Down Expand Up @@ -72,6 +74,7 @@ pub struct GlassWindow {
present_mode: PresentMode,
alpha_mode: CompositeAlphaMode,
surface_format: TextureFormat,
desired_maximum_frame_latency: u32,
exit_on_esc: bool,
has_focus: bool,
last_surface_size: [u32; 2],
Expand Down Expand Up @@ -105,6 +108,7 @@ impl GlassWindow {
alpha_mode: config.alpha_mode,
surface_format: config.surface_format,
exit_on_esc: config.exit_on_esc,
desired_maximum_frame_latency: config.desired_maximum_frame_latency,
has_focus: false,
last_surface_size: size,
})
Expand All @@ -120,7 +124,7 @@ impl GlassWindow {
present_mode: self.present_mode,
alpha_mode: self.alpha_mode,
view_formats: vec![],
desired_maximum_frame_latency: 2,
desired_maximum_frame_latency: self.desired_maximum_frame_latency,
};
self.configure_surface(device, &config);
self.last_surface_size = [size.width, size.height];
Expand Down

0 comments on commit c3c645f

Please sign in to comment.