aboutsummaryrefslogtreecommitdiffstats
path: root/keyboard.c
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2012-03-09 18:40:34 -0800
committerH. Peter Anvin <hpa@zytor.com>2012-03-09 18:40:34 -0800
commit2ff9ba56832017ddc4227cece65fa0f83ccc7064 (patch)
treee505ef5f006e4171588de05592cb4bbbf47feb59 /keyboard.c
parentb444e1737742e091339f1a7b083adc9fa4e06c08 (diff)
downloadgrv-2ff9ba56832017ddc4227cece65fa0f83ccc7064.tar.gz
grv-2ff9ba56832017ddc4227cece65fa0f83ccc7064.tar.xz
grv-2ff9ba56832017ddc4227cece65fa0f83ccc7064.zip
Aggregate screen updates
Aggregate screen updates to one per cycle, using SDL_UpdateRects(). Hopefully this should avoid the sluggishness on MacOS X, but that remain to be seen...
Diffstat (limited to 'keyboard.c')
-rw-r--r--keyboard.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/keyboard.c b/keyboard.c
index bcb905b..5d586c8 100644
--- a/keyboard.c
+++ b/keyboard.c
@@ -70,11 +70,14 @@ SDL_KeyboardEvent *get_key(void)
if ( (ke = poll_key()) )
return ke;
+ update_screen();
+
while ( SDL_WaitEvent(&event) ) {
if ( event.type == SDL_KEYDOWN )
return &event.key;
else if ( event.type == SDL_USEREVENT && event.user.code == event_blink )
update_blink();
}
+
return NULL;
}