Changeset 199 for libcaca/trunk/examples/demo.c
- Timestamp:
- Nov 19, 2003, 6:32:10 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libcaca/trunk/examples/demo.c
r195 r199 79 79 //pixbuf = gdk_pixbuf_new_from_file("/home/sam/pix/gradient.png", NULL); 80 80 //pixbuf = gdk_pixbuf_new_from_file("/home/sam/pix/beastie.png", NULL); 81 pixbuf = gdk_pixbuf_new_from_file("/home/sam/pix/stitch.jpg", NULL); 81 //pixbuf = gdk_pixbuf_new_from_file("/home/sam/pix/stitch.jpg", NULL); 82 //pixbuf = gdk_pixbuf_new_from_file("/home/sam/pix/caca.jpg", NULL); 82 83 //pixbuf = gdk_pixbuf_new_from_file("/home/sam/pix/dranac.jpeg", NULL); 83 84 //pixbuf = gdk_pixbuf_new_from_file("/home/sam/artwork/aboire.png", NULL); … … 85 86 //pixbuf = gdk_pixbuf_new_from_file("/home/sam/lilkim02.jpg", NULL); 86 87 //pixbuf = gdk_pixbuf_new_from_file("/home/sam/etw.bmp", NULL); 88 pixbuf = gdk_pixbuf_new_from_file("/home/sam/pix/lena_std.png", NULL); 87 89 if(!pixbuf) return -2; 88 90 pixels = gdk_pixbuf_get_pixels(pixbuf); … … 100 102 while(!quit) 101 103 { 102 char key = caca_get_key();103 104 if( key&& demo)104 int event = caca_get_event(); 105 106 if(event && demo) 105 107 { 106 108 display_menu(); … … 108 110 demo = NULL; 109 111 } 110 else if( key)112 else if(event & CACA_EVENT_KEY_PRESS) 111 113 { 112 114 handle_key: 113 switch( key)115 switch(event & 0xff) 114 116 { 115 117 case 'q': … … 171 173 caca_clear(); 172 174 173 key = caca_get_key(); 174 if(key) 175 handle_event: 176 event = caca_get_event(); 177 if(event & CACA_EVENT_KEY_PRESS) 175 178 goto handle_key; 179 else if(event) 180 goto handle_event; 176 181 177 182 caca_refresh();
Note: See TracChangeset
for help on using the changeset viewer.