drawimage too slooowly in firts time

Monkey Targets Forums/Android/drawimage too slooowly in firts time

IceVAN(Posted 2013) [#1]
Hi!,

In Android DrawImage command is very slow the first time it is used, then it works fast.

in this example:
http://www.deliriumstudios.com/demoscene/scroll/index.html

(are 320 different images. Are 4 images loaded 80 times each..)

In android version, slowdown every time you draw a new image.
In html5 run perfect.

If you load the html5 version in android chrome, it run fast.


Midimaster(Posted 2013) [#2]
a little bit more information?!?


IceVAN(Posted 2013) [#3]
sorry. accidentally hit post.


benmc(Posted 2013) [#4]
This has been happening for a long time. I always create a loading screen first, draw at least 1 sprite from each loaded image behind a loading image so it draws once before going into the game and drawing them again, otherwise the game is REALLY choppy the first time through as each image is drawn.


AdamRedwoods(Posted 2013) [#5]
similar topic:
http://monkeycoder.co.nz/Community/posts.php?topic=5104

in addition to benmc's comments, you can also try an image atlas, as then it would load only one image.


therevills(Posted 2013) [#6]
When you first display an image it needs to be piped to the GPU, this is the slow time...

What I do is when all the images are loaded I draw them off screen during the loading screen, so when I want to draw them in the game I dont get the slow down.


Midimaster(Posted 2013) [#7]
@AdamRedwoods
the topic is different: I descripe problems of a big delay of 1.5 sec already with the single picture. My intend was to load a first splash screen picture to display anything, during the rest will be loaded in the background. But already this first 480x800pix 50k picture needs 1.5sec, only because there are 8k User Datas attached to this app.


benmc(Posted 2013) [#8]
You are just calling LoadImage once for each images right? Then referencing them from then on?