DrawImage delay

Monkey Targets Forums/Android/DrawImage delay

Supertino(Posted 2011) [#1]
Hey, how does Andriod handle loading and drawing images?

Reason being I can load an image(s) (and these are 240x320) in OnCreate but the first time I draw the image in OnRender there is a very noticable delay the first time It is drawn, almost as if it being loaded into memory on the DrawImage rather then LoadImage. After the first DrawImage there is no dely drawing that image again.

This is very noticable on emultor and my wildfire phone.


Canardian(Posted 2011) [#2]
Maybe you could preload all images by drawing all images once, but not showing them. Somehow like this:
Method OnRender()
	Cls
	if firstround
		firstround=False
		DrawAllImages
		Cls
	Else
		NormalGameDrawing
	End
End



Virtech(Posted 2011) [#3]
Hi

This problem is reported and confirmed as a bug here:
http://www.monkeycoder.co.nz/Community/posts.php?topic=419

Lumooja's solution does help. But is not ideal. Also this was not the case in v31. Probably related to the new gl driver in v32.

Also this bug is less noticeable with smaller images.


Supertino(Posted 2011) [#4]
Lumooja & Virtech - thanks for the confirmation and workaround i'll ignore it for now and continue with the project.


therevills(Posted 2011) [#5]
Just found this myself using V33...

In BlitzMax you could kind of cache the images before drawing them... can you do something similar in Monkey?


<edit>

Just found out you can cache them to VRAM even if you draw them off screen and if you have got an animimage you can just draw the first frame...

<edit />


Xaron(Posted 2011) [#6]
I have the same problem with the latest build 45 which is quite annoying.


Uncle(Posted 2011) [#7]
Yeah this problem has been about for a bit. Work around solutions have been posted here...

http://monkeycoder.co.nz/Community/posts.php?topic=1430


Xaron(Posted 2011) [#8]
Thanks! :)