Are you loading 28 PNGs in a single 1024x1024 texture or are you
loading 28 1024x1024 textures? If it's the latter, you need 112 MB of
RAM.

On Sat, Feb 4, 2012 at 7:52 AM, chris2404 <chrisb2...@gmail.com> wrote:
> I think that some Android devices dont have enough memory to load the
> amount of textures, although it could be something else causing the
> issue, as I said I really dont know what to do with this.
>
> There are 28 PNG's being loaded all 1024x1024 which come to a total of
> 4.8megs. Below is the OpenGL method for loading textures
>
>    GL10 gl = glGraphics.getGL();
>    int[] textureIds = new int[1];
>    gl.glGenTextures(1, textureIds, 0);
>    textureId = textureIds[0];
>
>    InputStream in = null;
>    try {
>        in = fileIO.readAsset(fileName);
>        Bitmap bitmap = BitmapFactory.decodeStream(in);
>        gl.glBindTexture(GL10.GL_TEXTURE_2D, textureId);
>        GLUtils.texImage2D(GL10.GL_TEXTURE_2D, 0, bitmap, 0);
>        setFilters(GL10.GL_LINEAR , GL10.GL_LINEAR);
>        gl.glBindTexture(GL10.GL_TEXTURE_2D, 0);
>        width = bitmap.getWidth();
>        height = bitmap.getHeight();
>        bitmap.recycle();
>    } catch(IOException e) {
>        throw new RuntimeException("Couldn't load texture '" +
> fileName +"'", e);
>    } finally {
>        if(in != null)
>            try { in.close(); } catch (IOException e) { }
>    }
> There are no issues on my Desire HD, but on a HTC Cha Cha a lot of
> textures dont appear at all and on a Galaxy S two textures just appear
> white. The Cha Cha throws this error while loading textures
>
> 02-04 15:46:28.907: E/Adreno200-ES20(1501): override1= 0xfffffffe,
> override2= 0xfff *
>
> Oddly if the Cha Cha is locked (OpenGL textures are destroyed) and
> then unlocked (reloaded textures) the particular textures that were
> not there initally are now, however different textures are now not
> visable.
>
> Is this a memory issue? If so is there a way around this?
>
> Thanks
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to android-developers@googlegroups.com
> To unsubscribe from this group, send email to
> android-developers+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en



-- 
Romain Guy
Android framework engineer
romain...@android.com

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to