labyrinth
diff src/android/amain.c @ 8:d3f1f74067b0
ops, forgot to swapbuffers on the android side
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Mon, 04 May 2015 04:56:44 +0300 |
parents | 45b91185b298 |
children |
line diff
1.1 --- a/src/android/amain.c Mon May 04 02:46:35 2015 +0300 1.2 +++ b/src/android/amain.c Mon May 04 04:56:44 2015 +0300 1.3 @@ -19,6 +19,7 @@ 1.4 1.5 static struct android_app *app; 1.6 static int win_width, win_height; 1.7 +static int init_done; 1.8 1.9 void android_main(struct android_app *app_ptr) 1.10 { 1.11 @@ -44,7 +45,10 @@ 1.12 return; 1.13 } 1.14 1.15 - game_display(get_time_msec()); 1.16 + if(init_done) { 1.17 + game_display(get_time_msec()); 1.18 + eglSwapBuffers(dpy, surf); 1.19 + } 1.20 } 1.21 } 1.22 1.23 @@ -71,10 +75,12 @@ 1.24 if(game_init() == -1) { 1.25 exit(1); /* initialization failed, quit */ 1.26 } 1.27 + init_done = 1; 1.28 break; 1.29 1.30 case APP_CMD_TERM_WINDOW: 1.31 /* cleanup */ 1.32 + init_done = 0; 1.33 game_shutdown(); 1.34 destroy_gl(); 1.35 break;