Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android: How to make game asset files readable from c++ code using ndk

Tags:

I am creating a game using the irrlicht c++ 3D graphics engine port to android platform. The graphics engine is written in c++. I need to be able to load meshes and textures etc from c++ code. My current plan is to place all the game asset files in either the res/raw directory or the assets directory then on startup copy these files to the sdcard so they are accessable from the irrlicht c++ code. Is this the best way to make the game media files accessable from c++?

like image 620
slytron Avatar asked Feb 17 '10 04:02

slytron


1 Answers

There are several ways to do this...they each have their own limitations so I can't give a good recommendation without knowing more about your situation. Here are some links to discussions with some advice that may help you out:

http://groups.google.com/group/android-ndk/browse_thread/thread/842ca9d7d82995b0

http://groups.google.com/group/android-ndk/browse_thread/thread/4e25a5dfd46f8fea/1269bcd10bdb066d?lnk=gst&q=apk+compressed#1269bcd10bdb066d

I can give you more specific suggestions if i knew a) How many resources you needed to access b) The size of the largest resource you will encounter, more specifically, are all of your resources < 1MB in size uncompressed?

like image 188
cjserio Avatar answered Oct 22 '22 07:10

cjserio