SDL Android compilation note

Source: Internet
Author: User

  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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.