1
0
Fork 0
forked from AbleOS/ableos
ableOS_v1Change/sysdata/programs/fb_driver/src/examples/strobe.hb
2024-08-20 13:03:39 +01:00

20 lines
469 B
Plaintext

.{clear, create_buffer, present} := @use("../lib.hb")
/* expected result: (EPILEPSY WARNING)
the screen rapidly flashes red then black */
example := fn(): void {
// creates a back buffer, which we write to, to avoid screen flickering
buffer := create_buffer()
loop {
// screen go red
clear(buffer, .(0, 0, 255, 0))
// show the red
present(buffer)
// screen go black
clear(buffer, .(0, 255, 255, 0))
// show the black
present(buffer)
}
return
}