#[derive(Debug, Clone)]
pub struct WindowConfig {
pub title: String,
pub width: u32,
pub height: u32,
pub resizable: bool,
pub maximized: bool,
pub vsync: bool,
}
impl Default for WindowConfig {
fn default() -> Self {
Self {
title: "RunMat - Interactive Visualization | Powered by Dystr".to_string(),
width: 1200,
height: 800,
resizable: true,
maximized: false,
vsync: true,
}
}
}
#[cfg(feature = "gui")]
pub struct PlotWindow<'window> {
pub window: std::sync::Arc<winit::window::Window>,
pub event_loop: Option<winit::event_loop::EventLoop<()>>,
pub plot_renderer: crate::core::PlotRenderer,
pub plot_overlay: crate::gui::PlotOverlay,
pub surface: wgpu::Surface<'window>,
pub depth_texture: wgpu::Texture,
pub depth_view: wgpu::TextureView,
pub egui_ctx: egui::Context,
pub egui_state: egui_winit::State,
pub egui_renderer: egui_wgpu::Renderer,
pub config: WindowConfig,
pub mouse_position: glam::Vec2,
pub is_mouse_over_plot: bool,
pub needs_initial_redraw: bool,
pub pixels_per_point: f32,
pub mouse_left_down: bool,
pub active_drag_axes: Option<usize>,
pub close_signal: Option<std::sync::Arc<std::sync::atomic::AtomicBool>>,
}
#[cfg(not(feature = "gui"))]
pub struct PlotWindow;
#[cfg(not(feature = "gui"))]
impl PlotWindow {
pub async fn new(_config: WindowConfig) -> Result<Self, Box<dyn std::error::Error>> {
Err("GUI feature not enabled".into())
}
pub fn add_test_plot(&mut self) {
}
pub fn run(self) -> Result<(), Box<dyn std::error::Error>> {
Err("GUI feature not enabled".into())
}
pub fn install_close_signal(&mut self, _signal: std::sync::Arc<std::sync::atomic::AtomicBool>) {
}
}