Time for action – loading a texture in OpenGL ES

PNG is a complex format to read. So let's embed libpng third-party library:

  1. Go to the libpng website at http://www.libpng.org/pub/png/libpng.html and download the libpng source package (version 1.5.2 in this book).


    Original libpng 1.5.2 archive is provided with this book in Chapter6/Resource folder under the name lpng152.zip. A second archive lpng152_ndk.zip with the modifications made in the following steps is also available.

  2. Create a folder libpng inside $ANDROID_NDK/sources/. Move all files from the libpng package in it.
  3. Copy file libpng/scripts/pnglibconf.h.prebuilt into root folder libpng with other source files. Rename it pnglibconf.h.
  4. Write an Android.mk file inside $ANDROID_NDK/sources with ...

Get Android NDK Beginner's Guide now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.