mirror of
https://github.com/9fans/plan9port.git
synced 2025-01-24 11:41:58 +00:00
flushdisplay (erik quanstrom)
This commit is contained in:
parent
94bd4b6c2c
commit
190f5e7cb2
1 changed files with 9 additions and 4 deletions
|
@ -20,12 +20,14 @@ eresized(int new)
|
|||
|
||||
draw(screen, screen->r, display->white, nil, ZP);
|
||||
drawop(screen, screen->r, image, nil, image->r.min, S);
|
||||
flushimage(display, 1);
|
||||
}
|
||||
|
||||
void
|
||||
main(int argc, char **argv)
|
||||
{
|
||||
int fd;
|
||||
char *label;
|
||||
Event e;
|
||||
|
||||
ARGBEGIN{
|
||||
|
@ -42,16 +44,20 @@ main(int argc, char **argv)
|
|||
if(argc == 1){
|
||||
if((fd = open(argv[0], OREAD)) < 0)
|
||||
sysfatal("open %s: %r");
|
||||
}else
|
||||
label = argv[0];
|
||||
}else{
|
||||
fd = 0;
|
||||
label = nil;
|
||||
}
|
||||
|
||||
if(initdraw(0, nil, nil) < 0)
|
||||
if(initdraw(0, nil, label) < 0)
|
||||
sysfatal("initdraw: %r");
|
||||
|
||||
if((image=readimage(display, fd, 0)) == nil)
|
||||
sysfatal("readimage: %r");
|
||||
|
||||
drawresizewindow(Rect(0,0,Dx(image->r),Dy(image->r)));
|
||||
if(winsize == nil)
|
||||
drawresizewindow(Rect(0,0,Dx(image->r),Dy(image->r)));
|
||||
|
||||
einit(Emouse|Ekeyboard);
|
||||
eresized(0);
|
||||
|
@ -60,7 +66,6 @@ main(int argc, char **argv)
|
|||
case Ekeyboard:
|
||||
if(e.kbdc == 'q' || e.kbdc == 0x7F)
|
||||
exits(nil);
|
||||
eresized(0);
|
||||
break;
|
||||
case Emouse:
|
||||
break;
|
||||
|
|
Loading…
Reference in a new issue