I would just pre load all my bitmaps on start. The only reason I would think about loading/unloading bitmaps in real time would be for resource management reasons and then you would only do it when convenient (ie betweens levels, etc). This is most likely the wrong answer as I don't know what you mean by "GC".
On Jul 5, 4:56 pm, sebastian bossert <seboss...@gmail.com> wrote: > How can I pre-allocate the memory needed in Bitmap.createBitmap(..) so > the GC doesn't run? I'm writing a realtime game so the GC should not > run, at the moment my game "stutters" every few frames (2sec). Here's > the code bugging me: > > this.bmp = Bitmap.createBitmap(SPRITESHEET, Bird.mCurFrame * > BIG_W[mUseBird], 0, > BIG_W[mUseBird], BIG_H[mUseBird], mat, true); > super.drawPlaceable(canv); > > mat.preScale((float)0.6, (float)0.6); > this.bmp = Bitmap.createBitmap(SPRITESHEET, Bird.mCurFrame * > BIG_W[mUseBird], 0, > BIG_W[mUseBird], BIG_H[mUseBird], mat, true); -- 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