Ignore:
Timestamp:
Jan 18, 2004, 5:17:35 AM (18 years ago)
Author:
Sam Hocevar
Message:
  • src/graphics.c: + When resizing under X11, copy the old pixmap to the new one.
  • examples/cacaview.c: + Resizing support.
File:
1 edited

Legend:

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

    r352 r354  
    112112    while(!quit)
    113113    {
    114         int ww = caca_get_width();
    115         int wh = caca_get_height();
    116 
     114        int ww, wh;
    117115        unsigned int event, new_status = 0, new_help = 0;
    118116
     117        ww = caca_get_width();
     118        wh = caca_get_height();
     119
    119120        if(update)
    120             event = caca_get_event(CACA_EVENT_KEY_PRESS);
     121            event = caca_get_event(CACA_EVENT_KEY_PRESS | CACA_EVENT_RESIZE);
    121122        else
    122             event = caca_wait_event(CACA_EVENT_KEY_PRESS);
     123            event = caca_wait_event(CACA_EVENT_KEY_PRESS | CACA_EVENT_RESIZE);
    123124
    124125        while(event)
     
    126127            unsigned int key = event & 0x00ffffff;
    127128
    128             switch(key)
     129            if(key) switch(key)
    129130            {
    130131            case 'n':
     
    232233            }
    233234
     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
    234243            if(status || new_status)
    235244                status = new_status;
     
    259268            caca_putstr((ww - strlen(buffer)) / 2, wh / 2, buffer);
    260269            caca_refresh();
     270            ww = caca_get_width();
     271            wh = caca_get_height();
    261272
    262273            unload_image();
Note: See TracChangeset for help on using the changeset viewer.