pub struct SceneRenderArgs<'a> {
pub device: &'a wgpu::Device,
pub queue: &'a wgpu::Queue,
pub view: &'a wgpu::TextureView,
pub width: u32,
pub height: u32,
pub dt: f32,
pub animation_running: bool,
pub clear_color: [f32; 4],
}
pub trait Scene: Send {
fn render(
&mut self,
args: &SceneRenderArgs,
encoder: &mut wgpu::CommandEncoder,
) -> Result<(), String>;
fn resize(&mut self, device: &wgpu::Device, width: u32, height: u32) {
let _ = (device, width, height);
}
fn set_float_param(&mut self, _key: &str, _value: f32) {}
fn set_bool_param(&mut self, _key: &str, _value: bool) {}
fn set_vec4_param(&mut self, _key: &str, _value: [f32; 4]) {}
fn invoke_command(&mut self, _command: &str, _payload: &str) -> Result<(), String> {
Ok(())
}
}