Android Asset Management with SDL2

RWops is the way to go. Everything is cross-platform, so my Android code is identical to the PC.I have sub-directories “images”, “sound”, “levels”, etc. I copy all these directories into the android assets directory and they’re picked up the same way on both platforms. So, basically, “assets” is the Android root directory.

Does FreeType have a FT_New_Face_From_Memory(), or something? A good library shouldn’t restrict you to only using file names as parameters. It should offer loading from a stream, or from memory.

I opted to go with LodePNG for images. I load the file into memory using SDL_RWops and there’s a lodepng_decode32() which takes a pointer to memory as source. You can override PNG’s internal memory handlers to make it conform to any internal garbage collection, too, since image decoding can be memory intensive.

There is FT_New_Memory_Face, you need to keep the file contents in
memory until you don’t need the font anymore.On 26-Aug-15 16:10, AntTheAlchemist wrote:

Does FreeType have a FT_New_Face_From_Memory(), or something? A good
library shouldn’t restrict you to only using file names as parameters.
It should offer loading from a stream, or from memory.

I opted to go with LodePNG for images. I load the file into memory
using SDL_RWops and there’s a lodepng_decode32() which takes a pointer
to memory as source. You can override PNG’s internal memory handlers
to make it conform to any internal garbage collection, too, since
image decoding can be memory intensive.