aboutsummaryrefslogtreecommitdiff
path: root/calibrate.c
diff options
context:
space:
mode:
authorcnlohr <lohr85@gmail.com>2017-03-11 18:33:04 -0500
committercnlohr <lohr85@gmail.com>2017-03-11 18:33:04 -0500
commita96dd89c915b5721ed3ce9d41a1d2388651e9ce7 (patch)
tree69b65fcc43f4cdbd76a97603cfb9837e0fd772c6 /calibrate.c
parent4d85e6d6b3bb55d56d190414f7c1549ba2107c43 (diff)
downloadlibsurvive-a96dd89c915b5721ed3ce9d41a1d2388651e9ce7.tar.gz
libsurvive-a96dd89c915b5721ed3ce9d41a1d2388651e9ce7.tar.bz2
general updates from the current livestream.
Diffstat (limited to 'calibrate.c')
-rw-r--r--calibrate.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/calibrate.c b/calibrate.c
index 82da7a7..be506a1 100644
--- a/calibrate.c
+++ b/calibrate.c
@@ -13,6 +13,7 @@
#include "src/survive_config.h"
struct SurviveContext * ctx;
+int quit = 0;
void HandleKey( int keycode, int bDown )
{
@@ -26,6 +27,10 @@ void HandleKey( int keycode, int bDown )
{
survive_send_magic(ctx,0,0,0);
}
+ if( keycode == 'Q' || keycode == 'q' )
+ {
+ quit = 1;
+ }
}
void HandleButton( int x, int y, int button, int bDown )
@@ -163,10 +168,13 @@ int main()
return 1;
}
- while(survive_poll(ctx) == 0)
+ while(survive_poll(ctx) == 0 && !quit)
{
//Do stuff.
}
+
+ survive_close( ctx );
+
printf( "Returned\n" );
}