简体   繁体   中英

libGDX - Where are the textures stored?

As you all know, android has a memory limit of 16mb per application (or higher on other devices). I started to develop an rpg and as you also should know, these kinds of games need more than 16 MB because of the graphics.

When you write parts of the code in C with the NDK, there is no memory limit (making games as dungeon defenders possible). libGDX is partly coded in C for better performance.

So, here's my question:

Does it store the textures in the Java part or in the native C part?

Textures are stored in the VRAM on your device's GPU. When your graphic engine loads textures they are probably loaded from a native method, but your textures are still in the VRAM.

Important , it doesn't explicity store the textures in the "Java" or "C" part and there are no such parts where they are stored. When you're getting back an int from a loadTexture() function that's only a "key" to access the texture on the VRAM.

Maximum amount of textures (and VBO:s) depends on the maximum level of VRAM on your device's GPU.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM