Ignore:
Timestamp:
Jan 11, 2004, 7:09:01 PM (17 years ago)
Author:
Sam Hocevar
Message:
  • configure.ac src/time.c: + Look for Sleep in -lkernel32.
  • examples/cacaview.c: + Use caca_wait_event() instead of usleep()/caca_get_event().
File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcaca/trunk/examples/cacaview.c

    r336 r337  
    115115        unsigned int event, new_status = 0, new_help = 0;
    116116
    117         while((event = caca_get_event(CACA_EVENT_KEY_PRESS)))
     117        if(update)
     118            event = caca_get_event(CACA_EVENT_KEY_PRESS);
     119        else
     120            event = caca_wait_event(CACA_EVENT_KEY_PRESS);
     121
     122        while(event)
    118123        {
    119124            unsigned int key = event & 0x00ffffff;
     
    230235            if(help || new_help)
    231236                help = new_help;
     237
     238            event = caca_get_event(CACA_EVENT_KEY_PRESS);
    232239        }
    233240
     
    257264
    258265            free(buffer);
    259         }
    260 
    261         if(!update)
    262         {
    263 #if defined(HAVE_USLEEP)
    264             usleep(10000);
    265 #elif defined(HAVE_SLEEP)
    266             Sleep(10);
    267 #endif
    268             continue;
    269266        }
    270267
Note: See TracChangeset for help on using the changeset viewer.