Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

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

share|improve this question
    
Can you use compressed textures? –  Tetrad Aug 24 '12 at 21:59
    
@Tetrad How can i use them?You mean some compressed texture formats like PVR-TC?Or an optimization on bitmaps? –  droidmachine Aug 24 '12 at 22:01
1  
I mean PVR compressed textures. Those are compressed in-memory. –  Tetrad Aug 24 '12 at 22:02
    
@Tetrad Okey but only specific devices are supporting PVR compressed textures.How can i do that with all devices? –  droidmachine Aug 24 '12 at 22:15
1  
@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. –  r2d2rigo Aug 24 '12 at 23:24
add comment

1 Answer

up vote 0 down vote accepted

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

share|improve this answer
    
Okey but some devices are supporting that compression types.How can i achive them in all devices? –  droidmachine Aug 25 '12 at 22:53
    
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 –  Nicolas Brown Aug 25 '12 at 23:05
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.