From d2c59dbe9d6cc8dc4ff4d1e7949bfeddd8bef5d0 Mon Sep 17 00:00:00 2001 From: Cliff Click Date: Fri, 13 Nov 2026 13:35:58 -0800 Subject: Clean up Clock example --- chapter31/src/main/smp/sys/gfx.smp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'chapter31/src') diff --git a/chapter31/src/main/smp/sys/gfx.smp b/chapter31/src/main/smp/sys/gfx.smp index 6fa35117..ae203bd1 100644 --- a/chapter31/src/main/smp/sys/gfx.smp +++ b/chapter31/src/main/smp/sys/gfx.smp @@ -23,12 +23,14 @@ val open = { u8[~] title, u32 width, u32 height -> i64 ptr = aryu8.str0(title); simple_gfx_open(ptr,width,height); }; + // Array length must be width*height. The native layer copies for OS repaints; // it never keeps a pointer into the Simple heap after this call returns. val present = { u32[~] pixels -> i64 ptr = pixels; simple_gfx_present(ptr,pixels#); }; + // wait=true waits up to 17ms, waking early for input to avoid a busy loop. val poll = { bool wait -> simple_gfx_poll(wait); }; val mouseX = { -> simple_gfx_mouse_x(); }; -- cgit v1.2.3