blank.c (568B)
1 /* solid color fill scene */ 2 3 #include <u.h> 4 #include <libc.h> 5 #include <draw.h> 6 7 #include "noise.h" 8 9 #include "blank.h" 10 11 struct Blank_State { 12 Image *fill; 13 } bls; 14 15 void blank_init(void *) 16 { 17 lockdisplay(display); 18 bls.fill = allocimage(display, Rect(0, 0, 1, 1), RGB24, 1, DGreen); 19 unlockdisplay(display); 20 } 21 22 void blank_draw(void *) 23 { 24 draw(screen, screen->r, bls.fill, nil, ZP); 25 } 26 27 void blank_stop(void *) 28 { 29 lockdisplay(display); 30 freeimage(bls.fill); 31 unlockdisplay(display); 32 } 33 34 Scene BlankScene = { 35 "solid filler", 36 blank_init, 37 blank_draw, 38 blank_stop, 39 nil};