pub fn start(run: fn(nanos: u64) -> ()) {
    let window: &mut Box<Window> = unsafe { std::mem::transmute(&mut WINDOW) };

    /*********************/
    /* Declare Variables */
    /*********************/
    unsafe {
        std::ptr::write(window, Box::new(std::mem::zeroed()));
    }

    /*********************/
    /* Create The Window */
    /*********************/

    let mut win = None;

    // Try to initialize Wayland first.
    #[cfg(unix)]
    {
        if win.is_none() {
            win = wayland::new(window);
        }
    }

    // Hopefully we found one of the backends.
    win.or_else(|| {
        panic!("Couldn't find a window manager.");
    });
    /*    unsafe {
        std::ptr::write(
            &mut window.nwin,
            win.or_else(|| {
                panic!("Couldn't find a window manager.");
            }).unwrap(),
        );
    }*/

    /**********************/
    /* Initialize Drawing */
    /**********************/

    let mut draw = None;

    // Try to initialize OpenGL(ES).
    {
        draw = draw.or_else(|| opengl::new(window));
    }

    // Hopefully we found one of the backends.
    unsafe {
        std::ptr::write(
            &mut window.draw,
            draw.or_else(|| {
                panic!("Couldn't find a graphics API.");
            })
            .unwrap(),
        );
    }

    /****************************/
    /* Connect Window & Drawing */
    /****************************/

    window.nwin.connect(&mut window.draw);

    /*******************/
    /* Set Redraw Loop */
    /*******************/

    unsafe {
        std::ptr::write(&mut window.redraw, run);
    }

    //    unsafe {
    //        std::ptr::write(&mut window.context, (new)());
    //    }

    /*********************/
    /* Enter Render Loop */
    /*********************/

    window.nwin.main_loop();
}
/// Start the Wayland + OpenGL application.
Start the Wayland + OpenGL application.
Start the Wayland + OpenGL application .
pub fn start(run: fn(nanos: u64) -> ()) {
    let window: &mut Box<Window> = unsafe { std::mem::transmute(&mut WINDOW) };
    /*********************/
    /* Declare Variables */
    /*********************/
    unsafe {
        std::ptr::write(window, Box::new(std::mem::zeroed()));
    }
    /*********************/
    /* Create The Window */
    /*********************/
    let mut win = None;
    // Try to initialize Wayland first.
    #[cfg(unix)]
    {
        if win.is_none() {
            win = wayland::new(window);
        }
    }
    // Hopefully we found one of the backends.
    win.or_else(|| {
        panic!("Couldn't find a window manager.");
    });
    /*    unsafe {
        std::ptr::write(
            &mut window.nwin,
            win.or_else(|| {
                panic!("Couldn't find a window manager.");
            }).unwrap(),
        );
    }*/
    /**********************/
    /* Initialize Drawing */
    /**********************/
    let mut draw = None;
    // Try to initialize OpenGL(ES).
    {
        draw = draw.or_else(|| opengl::new(window));
    }
    // Hopefully we found one of the backends.
    unsafe {
        std::ptr::write(
            &mut window.draw,
            draw.or_else(|| {
                panic!("Couldn't find a graphics API.");
            })
            .unwrap(),
        );
    }
    /****************************/
    /* Connect Window & Drawing */
    /****************************/
    window.nwin.connect(&mut window.draw);
    /*******************/
    /* Set Redraw Loop */
    /*******************/
    unsafe {
        std::ptr::write(&mut window.redraw, run);
    }
    //    unsafe {
    //        std::ptr::write(&mut window.context, (new)());
    //    }
    /*********************/
    /* Enter Render Loop */
    /*********************/
    window.nwin.main_loop();
}
pub fn start ( run : fn ( nanos : u64 ) -> ( ) ) { let window : & mut Box < Window > = unsafe { std :: mem :: transmute ( & mut WINDOW ) } ; /*********************/ /* Declare Variables */ /*********************/ unsafe { std :: ptr :: write ( window , Box :: new ( std :: mem :: zeroed ( ) ) ) ; } /*********************/ /* Create The Window */ /*********************/ let mut win = None ; // Try to initialize Wayland first. # [ cfg ( unix ) ] { if win . is_none ( ) { win = wayland :: new ( window ) ; } } // Hopefully we found one of the backends. win . or_else ( | | { panic ! ( " " ) ; } ) ; /*    unsafe {
        std::ptr::write(
            &mut window.nwin,
            win.or_else(|| {
                panic!("Couldn't find a window manager.");
            }).unwrap(),
        );
    }*/ /**********************/ /* Initialize Drawing */ /**********************/ let mut draw = None ; // Try to initialize OpenGL(ES). { draw = draw . or_else ( | | opengl :: new ( window ) ) ; } // Hopefully we found one of the backends. unsafe { std :: ptr :: write ( & mut window . draw , draw . or_else ( | | { panic ! ( " " ) ; } ) . unwrap ( ) , ) ; } /****************************/ /* Connect Window & Drawing */ /****************************/ window . nwin . connect ( & mut window . draw ) ; /*******************/ /* Set Redraw Loop */ /*******************/ unsafe { std :: ptr :: write ( & mut window . redraw , run ) ; } //    unsafe { //        std::ptr::write(&mut window.context, (new)()); //    } /*********************/ /* Enter Render Loop */ /*********************/ window . nwin . main_loop ( ) ; }
Start the Wayland + OpenGL application.
Start the Wayland + OpenGL application .
run
fn(nanos: u64) -> ()
nanos
u64
run
fn(nanos: u64) -> ()
nanos
u64