Reputation:
What's the best way to load textures of unknow size using C++ to use them in OpenGL ES rendering(with Android NDK)? Is there any library for working with image assets?
Upvotes: 1
Views: 1304
Reputation: 410
Arguably size is irrelevant at the point when you open the files you're after. In regards to opening textures, try using the AAssetManager_open command (it's part of the ndk). It resturns an AAsset pointer which has an in memory version of your file. You can then open that using some image library such as libPNG (which will have to be compiled for Android).
Try having a look at julienr's source code, which has really good examples of doing purely ndk routines.
Upvotes: 1