Switch from allegro backend to SDL backend for android build.
authorDaniel G <giri@nwrk.biz>
Tue, 12 Feb 2019 20:16:58 +0000 (21:16 +0100)
committerDaniel G <giri@nwrk.biz>
Tue, 12 Feb 2019 20:16:58 +0000 (21:16 +0100)
_template/Makefile
_template/packages/nanox/Makefile
_template/packages/sdl2.0.8/MainActivity.java
_template/src/Makefile
_template/src/android/AndroidManifest.xml

index 71ddfa8..001b2d6 100644 (file)
@@ -8,7 +8,7 @@ WORKDIR = $(shell pwd)
 APPINFO = $(WORKDIR)/src/appinfo
 
 all: deps _template create_installers
-deps: freetype allegro nanox fltk
+deps: freetype sdl nanox fltk
 create_installers: linux32_package linux_arm_package windows_package android_package
 
 #### Dependencies
index d8fae9d..070db88 100644 (file)
@@ -8,7 +8,7 @@ WORKDIR = $(shell pwd)
 ANDROID_TARGET_VER=23
 
 
-all: unpack android_arm_allegro
+all: unpack android_arm_sdl
 
 unpack:
        unzip -o microwindows-master.zip
index 0716532..1047ffb 100644 (file)
@@ -7,4 +7,23 @@ public class MainActivity extends SDLActivity {
    public MainActivity() {
       super();
    }
+
+  // libraries to load
+  @Override
+   protected String[] getLibraries() {
+        return new String[] {
+            "SDL2",
+            // "SDL2_image",
+            // "SDL2_mixer",
+            // "SDL2_net",
+            // "SDL2_ttf",
+            "_template"
+        };
+    }
+
+  // C++ program entrypoint
+  @Override
+  protected String getMainFunction() {
+        return "main";
+    }
 }
index 42e205f..bd85c50 100644 (file)
@@ -79,8 +79,12 @@ ANDROID_KEYSTORE_PW=android
 ANDROID_ARCH=arm
 ANDROID_ARCH_VER=armeabi-v7a
 ANDROID_COMPILER_PREFIX=arm-linux-androideabi
-ANDROID_BACKEND=liballegro.so
-ANDROID_BACKEND_JAVA=liballeg
+
+# liballegro.so or libSDL2.so
+ANDROID_BACKEND=libSDL2.so
+
+# liballeg or libsdl
+ANDROID_BACKEND_JAVA=libsdl
 
 # dependent on values above
 ANDROID_PLATORM=android-$(ANDROID_PLATORM_VERSION)
@@ -121,7 +125,7 @@ LIBDIR_ANDROID += -L$(ANDROID_NDK_ROOT)/sources/cxx-stl/llvm-libc++/libs/$(ANDRO
 CFLAGS_ANDROID  = $(CFLAGS) --sysroot=$(ANDROID_NDK_ROOT)/platforms/$(ANDROID_PLATORM)/arch-$(ANDROID_ARCH) -D_ANDROID
 RESINC_ANDROID = assets
 LDFLAGS_ANDROID  =  $(LDFLAGS) -shared --sysroot=$(ANDROID_NDK_ROOT)/platforms/$(ANDROID_PLATORM)/arch-$(ANDROID_ARCH)
-LIB_ANDROID  = $(LIB) -lc++ -lNX11 -lnano-X -lfreetype -lm -Wl,-Bdynamic -lallegro -lz
+LIB_ANDROID  = $(LIB) -lc++ -lNX11 -lnano-X -lfreetype -lm -Wl,-Bdynamic -lSDL2 -lz
 RESLIST_ANDROID=$(shell find $(RESINC_ANDROID) -type f -follow)
 
 ###################################
index 1c79915..e38dfe3 100644 (file)
@@ -10,6 +10,7 @@
   <application
       android:label="_template"
       android:icon="@mipmap/ic_launcher"
+      android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
       android:debuggable="false">
     <activity
         android:name=".MainActivity"