INNER CODE UNIT · Rust

glyphs

PistonDevelopers/piston_window · src/piston_script.rs:233

                let glyphs = unsafe { &mut *Current::<Vec<GlyphCache>>::new() };
                let textures = unsafe { &mut *Current::<Vec<Texture>>::new() };
                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()?;

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…