Time for action – compiling and embedding libpng module

Let's load an OpenGL texture from a PNG file in DroidBlaster.

  1. Go to the website http://www.libpng.org/pub/png/libpng.html and download the libpng source package (which is Version 1.6.10 in this book).

    Note

    The original libpng 1.6.10 archive is provided with this book in the Libraries/libpng folder.

    Create a folder named libpng inside $ANDROID_NDK/sources/. Move all files from the libpng package into this.

    Copy the file libpng/scripts/pnglibconf.h.prebuilt into the root folder libpng with other source files. Rename it as pnglibconf.h.

    Note

    The folder $ANDROID_NDK/sources is a special folder considered as a module folder by default. It contains reusable libraries. See Chapter 9, Porting Existing Libraries ...

Get Android NDK Beginner's Guide - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.