Game Development Reference
In-Depth Information
Getting ready
Download the sources of libvorbis and libtheora codecs from http://www.xiph.org/
downloads and the libmodplug library from http://modplug-xmms.sourceforge.net .
How to do it...
1.
libvorbis and libtheora both depend on libogg. The compilation of these libraries is
straightforward with the provided makeiles and a standard Android.mk ile with
the list of source iles.
Makefiles for libvorbis and libtheora libraries must refer to the include
directories of libogg.
2.
libmodplug is an open source tracker music decoder by Olivier Lapicque. We provide
a shortened version of his library, with loaders for the most popular tracker ile
formats. It consists of only three iles, and there is an excellent support for Android
and Linux. The library does not have any problems with big-endian CPUs.
Using the FreeImage graphics library
FreeImage is a portable graphics library that uniies loading and saving of popular image
formats, such as JPEG, TIFF, PNG, TGA, high dynamic range EXR images, and many others.
Getting ready
Download the most recent FreeImage source code from the library home page: http://
freeimage.sourceforge.net . We used the Version 3.15.4, released in October 2012.
How to do it...
1.
Both the Android.mk and Application.mk iles are pretty standard. The former
should contain this deinition of the GLOBAL_CFLAGS :
GLOBAL_CFLAGS := -O3 -DHAVE_CONFIG_H=1 -DFREEIMAGE_LIB
-isystem $(SYSROOT)/usr/include/
2.
Unfortunately, the Android NDK runtime library is missing the lfind() function
used inside FreeImage (in the LibTIFF4 library, which is used in FreeImage).
Here is its implementation:
 
Search WWH ::




Custom Search