0
\$\begingroup\$

I'm using an opengl es based framework to create my game.I have an out of memory problem on some devices.I have 15 textures with a size 1024x1024(totally 10 mb).On memory they covers a lot of space.Some devices are exiting from game on loading time

I want to reduce memory use and how can i do that?Maybe a solution when i loading bitmaps into memory will be great.That's my texture class:Texture.java

\$\endgroup\$
5
  • \$\begingroup\$ Can you use compressed textures? \$\endgroup\$
    – Tetrad
    Aug 24, 2012 at 21:59
  • \$\begingroup\$ @Tetrad How can i use them?You mean some compressed texture formats like PVR-TC?Or an optimization on bitmaps? \$\endgroup\$ Aug 24, 2012 at 22:01
  • 1
    \$\begingroup\$ I mean PVR compressed textures. Those are compressed in-memory. \$\endgroup\$
    – Tetrad
    Aug 24, 2012 at 22:02
  • \$\begingroup\$ @Tetrad Okey but only specific devices are supporting PVR compressed textures.How can i do that with all devices? \$\endgroup\$ Aug 24, 2012 at 22:15
  • 1
    \$\begingroup\$ @droidmachine ETC texture compression is supported on all Android devices with OS version 2.3 and newer. The downside is that ETC doesn't support alpha channel. \$\endgroup\$
    – r2d2rigo
    Aug 24, 2012 at 23:24

1 Answer 1

0
\$\begingroup\$

Texture compression it is. Here is a link explaining with example code snippet: https://stackoverflow.com/questions/9148795/android-opengl-texture-compression

\$\endgroup\$
2
  • \$\begingroup\$ Okey but some devices are supporting that compression types.How can i achive them in all devices? \$\endgroup\$ Aug 25, 2012 at 22:53
  • \$\begingroup\$ the link suggests u create a fallback if texture compression isnt supported. My suggestion is to store backup 256x256 or 512x512 of each image. That would make your app bigger tho, so i suggest you resize the 1024x1024 images after loading them instead. this should help: thinkandroid.wordpress.com/2009/12/25/resizing-a-bitmap \$\endgroup\$ Aug 25, 2012 at 23:05

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .