diff --git a/freeglut/web-src/docs/android.php b/freeglut/web-src/docs/android.php index 919b4c3..b45937e 100644 --- a/freeglut/web-src/docs/android.php +++ b/freeglut/web-src/docs/android.php @@ -8,14 +8,150 @@ setPageTitle("Android"); generateHeader($_SERVER['PHP_SELF']); ?> + +
+
+
+ FreeGLUT 3.0 introduces support for the Android platform.
+
+ This platform is different than traditional desktop platforms, requiring cross-compilation, interfacing with a touchscreen, and ability for your application to be paused and resumed at any time.
+
+ Here's how:
+
+
+ /usr/src/android-ndk-r7c/build/tools/make-standalone-toolchain.sh \ + --platform=android-9 \ + --install-dir=/usr/src/ndk-standalone-9 ++ +
+ PATH=/usr/src/ndk-standalone-9/bin:$PATH + cd /usr/src/freeglut-x.x/ + mkdir cross-android-gles2/ + cd cross-android-gles2/ + cmake \ + -D CMAKE_TOOLCHAIN_FILE=../android_toolchain.cmake \ + -D CMAKE_INSTALL_PREFIX=/usr/src/ndk-standalone-9/sysroot/usr \ + -D CMAKE_BUILD_TYPE=Debug \ + -D FREEGLUT_GLES2=ON \ + -D FREEGLUT_BUILD_DEMOS=NO \ + .. + make -j4 + make install + # Only static for now: + rm -f /usr/src/ndk-standalone-9/sysroot/usr/lib/libfreeglut-gles?.so* ++ +
For instance if you use the autotools:
+ ++ PATH=/usr/src/ndk-standalone-9/bin:$PATH + export PKG_CONFIG_PATH=/usr/src/ndk-standalone-9/sysroot/usr/share/pkgconfig + ./configure --host=arm-linux-androideabi --prefix=/somewhere + make + make install ++ +
If you use CMake, you may want to copy our Android toolchain + 'android_toolchain.cmake':
+ ++ PATH=/usr/src/ndk-standalone-9/bin:$PATH + export PKG_CONFIG_PATH=/usr/src/ndk-standalone-9/sysroot/usr/share/pkgconfig + cp .../freeglut-x.x/android_toolchain.cmake . + mkdir cross-android/ + cd cross-android/ + cmake \ + -D CMAKE_TOOLCHAIN_FILE=../android_toolchain.cmake \ + -D CMAKE_INSTALL_PREFIX=/somewhere \ + -D CMAKE_BUILD_TYPE=Debug \ + -D MY_PROG_OPTION=something ... \ + .. + make -j4 + make install ++ +
Check progs/test-shapes-gles1/
in the FreeGLUT
+ source distribution for a complete, stand-alone example.
+ mkdir freeglut-gles2/ + cp .../freeglut-x.x/android/gles2/Android.mk freeglut-gles2/ + ln -s /usr/src/ndk-standalone-9/sysroot/usr/include freeglut-gles2/include + ln -s /usr/src/ndk-standalone-9/sysroot/usr/lib freeglut-gles2/lib ++ +
+ LOCAL_STATIC_LIBRARIES := ... freeglut-gles2 + ... + $(call import-module,freeglut-gles2) ++ +
+ ndk-build NDK_MODULE_PATH=. ++ +