X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;f=src%2Fandroid%2Fmain.c;h=8c125960cf9de180c972520b4da89fb1ff3176f7;hb=72349449317fefb87372608ea3b81332e1ce0cd3;hp=0e409628098d4d241b179fa8a6738c81a52a1c9e;hpb=c7560762d55919077d830368a05da0ce223bc96a;p=andemo diff --git a/src/android/main.c b/src/android/main.c index 0e40962..8c12596 100644 --- a/src/android/main.c +++ b/src/android/main.c @@ -12,11 +12,12 @@ static int handle_touch_input(struct android_app *app, AInputEvent *ev); static int init_gl(void); static void destroy_gl(void); -static struct android_app *app; +struct android_app *app; + static EGLDisplay dpy; static EGLSurface surf; static EGLContext ctx; -static int running; +static int init_done, paused; static int width, height; @@ -43,7 +44,7 @@ void android_main(struct android_app *app_ptr) if(app->destroyRequested) { return; } - if(running) { + if(init_done && !paused) { demo_display(); eglSwapBuffers(dpy, surf); } @@ -56,10 +57,10 @@ static void handle_command(struct android_app *app, int32_t cmd) switch(cmd) { case APP_CMD_PAUSE: - running = 0; /* TODO: handle timers */ + paused = 1; /* TODO: handle timers */ break; case APP_CMD_RESUME: - running = 1; + paused = 0; break; case APP_CMD_INIT_WINDOW: @@ -70,11 +71,11 @@ static void handle_command(struct android_app *app, int32_t cmd) exit(1); } demo_reshape(width, height); - running = 1; + init_done = 1; break; case APP_CMD_TERM_WINDOW: - running = 0; + init_done = 0; demo_cleanup(); destroy_gl(); break;