aboutsummaryrefslogtreecommitdiff
path: root/life.cc
diff options
context:
space:
mode:
Diffstat (limited to 'life.cc')
-rw-r--r--life.cc9
1 files changed, 2 insertions, 7 deletions
diff --git a/life.cc b/life.cc
index 6f57c20..08a205a 100644
--- a/life.cc
+++ b/life.cc
@@ -42,14 +42,9 @@ int main(int, char*[]) {
draw(worldOffsetX, worldOffsetY, world);
while ( true ) {
- struct tb_event ev;
- int t = tb_poll_event(&ev);
+ struct tb_event ev{ guard.poll() };
- if ( t == -1 ) {
- return -1;
- }
-
- switch ( t ) {
+ switch ( ev.type ) {
case TB_EVENT_KEY:
switch ( ev.key ) {
case TB_KEY_ESC: