SDL 1.3 officially supports Android and OpenGL ES 1.1/2.0! Just a few days ago, I just had a hard time working. Now I will note about the compilation process. Although most of the processes have been clearly explained, there are still some small details to pay attention.
- First, download the 1.3 Non-official version of the source code from the SDL website. SDL uses the Hg management source code. Visit http://www.libsdl.org/hg.php to download the zippack (sdl-1.3.zip) applicable to Windows or tar for Linux.
Gzpackage (sdl-1.3.tar.gz), decompress it to any directory;
- Create a directory named SDL in the $ SDL \ Android-project \ JNI directory, and set the two directories SRC, include and file android in the $ SDL directory. copy mK to the Created directory. The directory structure should be as follows:
- Copy the SDL test file to the $ SDL \ Android-project \ JNI \ src directory, and change the android. mk. To test OpenGL ES, set testgles. C and the dependent common. C & Common. h. Copy the three files to the JNI \ src directory and. the MK file is changed as follows:
Local_path: = $ (call my-DIR) Include $ (clear_vars) Local_module: = Main Sdl_path: = ../SDL Local_c_includes: = $ (local_path)/$ (sdl_path)/include # Add your application source files here... Local_src_files: = $ (sdl_path)/src/main/Android/sdl_android_main.cpp \ Testgles. c Common. c Local_shared_libraries: = SDL Local_ldlibs: =-lglesvw.cm-llog Include $ (build_shared_library) |
- This test is based on OpenGL ES, so Android 2.0 and later versions are used. in properties, the target is changed from "Android-4" to "Android-8 ";
- Go to the $ SDL \ andorid-project directory in cygwin and run the "ndk-build v = 1" command to compile;
- Edit $ SDL \ Android-project \ Local. properties and point the SDK directory to your installation directory;
- When ant is installed, enter $ SDL \ Android-project, enter "ant debug", and then enter "ant install ", compile and install the SDL app on your phone or simulator and run it!
From http://blog.sina.com.cn/s/blog_4a0a39c30100rza9.html