- Android NDK Game Development Cookbook
- Sergey Kosarevsky Viktor Latypov
- 243字
- 2021-07-21 18:21:24
Introduction
This chapter explains how to port existing popular C/C++ libraries to Android using Android NDK. These libraries are widely used to implement feature-rich applications with graphics, sounds, and physical simulations entirely in C++. There is not much fun in simply compiling libraries. So, the parts related to FreeImage, FreeType, and Box2D provide minimal samples to demonstrate the functionality of each library. Audio and networking libraries are discussed in greater detail in the subsequent chapters. We will show you how to compile libraries and, of course, give some short samples and hints on how to start using them.
Typical caveats for porting libraries across different processors and operating systems are memory access (structure alignment/padding), byte-order (endianness), calling conventions, and floating-point issues. All the libraries described below address these issues quite well, and even if some of them do not officially support Android NDK, fixing this is just a matter of a few compiler switches.
To build any of the mentioned libraries, we need to create makefile for the Windows version and a pair of the Android.mk
and the Application.mk
files for Android NDK. The source files of the library are compiled to object files. A collection of object files is combined into an archive, which is also called a static library. Later, this static library can be passed as an input to the linker. We start with the Windows version because the Android.mk
and Application.mk
files are built on top of standard makefiles.
- 電腦組裝與維修從入門到精通(第2版)
- Intel FPGA/CPLD設計(高級篇)
- 數(shù)字邏輯(第3版)
- 電腦維護365問
- 分布式微服務架構:原理與實戰(zhàn)
- Mastering Adobe Photoshop Elements
- The Deep Learning with Keras Workshop
- WebGL Hotshot
- FL Studio Cookbook
- STM32自學筆記
- Spring Security 3.x Cookbook
- Raspberry Pi Home Automation with Arduino
- Advanced Machine Learning with R
- 分布式存儲系統(tǒng):核心技術、系統(tǒng)實現(xiàn)與Go項目實戰(zhàn)
- 筆記本電腦現(xiàn)場維修實錄