INNER CODE UNIT · Rust
window
PistonDevelopers/piston_window · src/piston_script.rs:235
let window = unsafe { &mut *Current::<PistonWindow>::new() };
if let Some(x) = window.draw_2d(e, |c, g, _| draw_2d(rt, glyphs, textures, c, g)) {x}
else {Err("Drawing failed".to_string())}
} else {
Ok(())
}
} else {
Err(NO_EVENT.into())
}
}
pub fn create_texture(rt: &mut Runtime) -> Result<Variable, String> {
use dyon::embed::{to_rust_object, PushVariable};
let image: Variable = rt.pop()?;
match image {
Variable::F64(id, _) => {