use bevy::prelude::*;
#[derive(Component, Debug, Copy, Clone, PartialEq)]
pub struct PixelsOptions {
pub width: u32,
pub height: u32,
pub scale_factor: f32,
pub auto_resize_buffer: bool,
pub auto_resize_surface: bool,
}
impl Default for PixelsOptions {
fn default() -> Self {
PixelsOptions {
width: 1280,
height: 720,
scale_factor: 1.0,
auto_resize_buffer: true,
auto_resize_surface: true,
}
}
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn default_options_match_default_window_size() {
let options = PixelsOptions::default();
assert_eq!(options.width, 1280);
assert_eq!(options.height, 720);
assert_eq!(options.scale_factor, 1.0);
assert!(options.auto_resize_buffer);
assert!(options.auto_resize_surface);
}
}