# HG changeset patch # User John Tsiombikas # Date 1430704604 -10800 # Node ID d3f1f74067b0c8c193d15c280ac49dd43be5f9bf # Parent b557812c45dbd1cc886646e1743f6cd7eaf22550 ops, forgot to swapbuffers on the android side diff -r b557812c45db -r d3f1f74067b0 .hgignore --- a/.hgignore Mon May 04 02:46:35 2015 +0300 +++ b/.hgignore Mon May 04 04:56:44 2015 +0300 @@ -9,3 +9,4 @@ \.properties$ \.apk$ ^android/proguard-project\.txt +\.xml$ diff -r b557812c45db -r d3f1f74067b0 android/Makefile --- a/android/Makefile Mon May 04 02:46:35 2015 +0300 +++ b/android/Makefile Mon May 04 04:56:44 2015 +0300 @@ -25,11 +25,11 @@ android_usr = $(NDK)/platforms/$(android_platform)/arch-arm/usr android_inc = -I$(android_usr)/include -I$(native_app_glue_dir) -android_libs = -llog -landroid -lEGL -lGLESv1_CM -lm +android_libs = -llog -landroid -lEGL -lGLESv1_CM -CFLAGS = -std=c99 -Wall -g -DAPP_NAME=\"$(name)\" \ +CFLAGS = -std=c99 -Wall -g -DAPP_NAME=\"$(name)\" -march=armv7-a -mfloat-abi=softfp \ $(android_inc) -I$(root)/src/android -I$(root)/src/gles $(incpaths) -LDFLAGS = -Wl,--fix-cortex-a8 -Wl,-z,defs $(android_libs) $(libpaths) +LDFLAGS = -Wl,--fix-cortex-a8 -Wl,-z,defs $(android_libs) $(libpaths) -lm .PHONY: debug debug: $(apk-debug) @@ -51,7 +51,7 @@ $(CC) -o $@ -shared $(obj) $(LDFLAGS) ant_files = *.xml *.properties proguard-project.txt -ant_dirs = bin libs res +ant_dirs = bin libs res obj src .PHONY: clean clean: diff -r b557812c45db -r d3f1f74067b0 src/android/amain.c --- a/src/android/amain.c Mon May 04 02:46:35 2015 +0300 +++ b/src/android/amain.c Mon May 04 04:56:44 2015 +0300 @@ -19,6 +19,7 @@ static struct android_app *app; static int win_width, win_height; +static int init_done; void android_main(struct android_app *app_ptr) { @@ -44,7 +45,10 @@ return; } - game_display(get_time_msec()); + if(init_done) { + game_display(get_time_msec()); + eglSwapBuffers(dpy, surf); + } } } @@ -71,10 +75,12 @@ if(game_init() == -1) { exit(1); /* initialization failed, quit */ } + init_done = 1; break; case APP_CMD_TERM_WINDOW: /* cleanup */ + init_done = 0; game_shutdown(); destroy_gl(); break; diff -r b557812c45db -r d3f1f74067b0 src/game.c --- a/src/game.c Mon May 04 02:46:35 2015 +0300 +++ b/src/game.c Mon May 04 04:56:44 2015 +0300 @@ -75,6 +75,8 @@ } player_init(&player, &level); + + glClearColor(1, 0, 0, 1); return 0; }