1#![allow(static_mut_refs)]
10#![no_main]
11use firefly_rust as ff;
12use std::cell::OnceCell;
13
14static mut IMAGE: OnceCell<ff::FileBuf> = OnceCell::new();
15
16#[unsafe(no_mangle)]
17extern "C" fn boot() {
18 let file = ff::load_file_buf("img").unwrap();
19 unsafe {
20 IMAGE.set(file).ok().unwrap();
21 }
22}
23
24#[unsafe(no_mangle)]
25extern "C" fn update() {
26 ff::clear_screen(ff::Color::White);
27 let image = unsafe { IMAGE.get().unwrap() };
28 let image: ff::Image = (image).into();
29 ff::draw_image(&image, ff::Point { x: 60, y: 60 });
30}