Changeset 354 for libcaca/trunk/examples
- Timestamp:
- Jan 18, 2004, 5:17:35 AM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libcaca/trunk/examples/cacaview.c
r352 r354 112 112 while(!quit) 113 113 { 114 int ww = caca_get_width(); 115 int wh = caca_get_height(); 116 114 int ww, wh; 117 115 unsigned int event, new_status = 0, new_help = 0; 118 116 117 ww = caca_get_width(); 118 wh = caca_get_height(); 119 119 120 if(update) 120 event = caca_get_event(CACA_EVENT_KEY_PRESS );121 event = caca_get_event(CACA_EVENT_KEY_PRESS | CACA_EVENT_RESIZE); 121 122 else 122 event = caca_wait_event(CACA_EVENT_KEY_PRESS );123 event = caca_wait_event(CACA_EVENT_KEY_PRESS | CACA_EVENT_RESIZE); 123 124 124 125 while(event) … … 126 127 unsigned int key = event & 0x00ffffff; 127 128 128 switch(key)129 if(key) switch(key) 129 130 { 130 131 case 'n': … … 232 233 } 233 234 235 if(event == CACA_EVENT_RESIZE) 236 { 237 caca_refresh(); 238 ww = caca_get_width(); 239 wh = caca_get_height(); 240 update = 1; 241 } 242 234 243 if(status || new_status) 235 244 status = new_status; … … 259 268 caca_putstr((ww - strlen(buffer)) / 2, wh / 2, buffer); 260 269 caca_refresh(); 270 ww = caca_get_width(); 271 wh = caca_get_height(); 261 272 262 273 unload_image();
Note: See TracChangeset
for help on using the changeset viewer.