use processing_glfw::GlfwContext; use processing::prelude::*; use processing_render::render::command::DrawCommand; fn main() { match sketch() { Ok(_) => { eprintln!("Sketch completed successfully"); exit(0).unwrap(); } Err(e) => { eprintln!("Sketch error: {:?}", e); exit(1).unwrap(); } }; } fn sketch() -> error::Result<()> { let mut glfw_ctx = GlfwContext::new(400, 400)?; init(Config::default())?; let width = 400; let height = 400; let surface = glfw_ctx.create_surface(width, height)?; let graphics = graphics_create(surface, width, height, TextureFormat::Rgba16Float)?; while glfw_ctx.poll_events() { graphics_begin_draw(graphics)?; graphics_record_command( graphics, DrawCommand::Rect { x: 10.0, y: 10.0, w: 100.0, h: 100.0, radii: [0.0, 0.0, 0.0, 0.0], }, )?; graphics_end_draw(graphics)?; } Ok(()) }