INNER CODE UNIT · Rust

Some

PistonDevelopers/piston_window · src/piston_script.rs:237

                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, _) => {
                let texture_context = unsafe {&mut *Current::<TextureContext>::new()};
                let images = unsafe { &*Current::<Vec<RgbaImage>>::new() };

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…