// Code that runs every frame.
Code that runs every frame.
Code that runs every frame .
fn mode_stop(app: &mut Ctx) {
    // Check for exit request
    if hid::Key::Back.pressed(0) {
        adi::old();
    }
    // Begin timing
    app.time += screen::dt();
    app.frames += 1;
    if app.time >= 1.0 {
        app.info = format!(
            "Caving {} - FPS: {}\nFinished!",
            env!("CARGO_PKG_VERSION"),
            app.frames
        );
        app.time -= 1.0;
        app.frames = 0;
    }
    // Render
    screen::draw(&mut |pixels, pitch| {
        let (_w, h) = screen::wh();
        let mut image = Image::new(Size((pitch / 4) as u16, h));
        image.clear_ptr(pixels.as_mut_ptr());
        image.text_ptr(
            [255, 255, 255, 255], // White
            (5.0, 5.0, 36.0),     // Pos. & Size
            &app.font,            // Font
            &app.info,            // String
            pixels.as_mut_ptr(),
        );
    });
}
fn mode_stop ( app : & mut Ctx ) { // Check for exit request if hid :: Key :: Back . pressed ( 0 ) { adi :: old ( ) ; } // Begin timing app . time += screen :: dt ( ) ; app . frames += 1 ; if app . time >= 1.0 { app . info = format ! ( " \n " env ( " " ) app frames ) ; app . time -= 1.0 ; app . frames = 0 ; } // Render screen :: draw ( & mut | pixels , pitch | { let ( _w , h ) = screen :: wh ( ) ; let mut image = Image :: new ( Size ( ( pitch / 4 ) as u16 , h ) ) ; image . clear_ptr ( pixels . as_mut_ptr ( ) ) ; image . text_ptr ( [ 255 , 255 , 255 , 255 ] , // White ( 5.0 , 5.0 , 36.0 ) , // Pos. & Size & app . font , // Font & app . info , // String pixels . as_mut_ptr ( ) , ) ; } ) ; }
Code that runs every frame.
Code that runs every frame .
app
&mut Ctx