1extern crate alto;
2
3use alto::{Alto, AltoResult};
4
5fn run() -> AltoResult<()> {
6 let alto = Alto::load_default()?;
7
8 for s in alto.enumerate_outputs() {
9 println!("Found device: {}", s.to_str().unwrap());
10 }
11
12 let device = alto.open(None)?; let context = device.new_context(None)?; context.set_position([1.0, 4.0, 5.0])?;
17 context.set_velocity([2.5, 0.0, 0.0])?;
18 context.set_orientation(([0.0, 0.0, 1.0], [0.0, 1.0, 0.0]))?;
19
20 let _source = context.new_static_source()?;
21
22 Ok(())
26}
27
28fn main() {
29 use std::process::exit;
30
31 if let Err(e) = run() {
32 println!("Failed to run basic example: {}", e);
33 exit(1);
34 }
35}