diff options
author | H. Peter Anvin <hpa@zytor.com> | 2012-03-09 18:40:34 -0800 |
---|---|---|
committer | H. Peter Anvin <hpa@zytor.com> | 2012-03-09 18:40:34 -0800 |
commit | 2ff9ba56832017ddc4227cece65fa0f83ccc7064 (patch) | |
tree | e505ef5f006e4171588de05592cb4bbbf47feb59 /keyboard.c | |
parent | b444e1737742e091339f1a7b083adc9fa4e06c08 (diff) | |
download | grv-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.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -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; } |