April 2015
Beginner to intermediate
494 pages
10h 26m
English
Let's now replace raw arrays with standard STL containers by following these steps:
jni/GraphicsManager.hpp header and include the headers:Vector, which defines an STL container encapsulating C arrays (with a few more interesting features such as dynamic resizing)Map, which encapsulates the equivalent of a Java HashMap (that is, an associative array)Then, remove the textureResource member in the TextureProperties structure. Use a map container instead of a raw array for mTextures (prefixed with the std namespace). The first parameter is the key type and the second the value type.
Finally, replace all the other raw arrays with a vector, as shown in the following:
... #include <android_native_app_glue.h> ...