forked from AbleOS/ableos
20 lines
469 B
Plaintext
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
|
||
|
}
|