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;
if(app->destroyRequested) {
return;
}
- if(running) {
+ if(init_done && !paused) {
demo_display();
eglSwapBuffers(dpy, surf);
}
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:
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;