Caching graphics to avoid drawing delay?

BlitzMax Forums/BlitzMax Programming/Caching graphics to avoid drawing delay?


I found a similar thing in BlitzPlus and it's because the image is held in RAM and the first time it's drawn it get's "uploaded" to the video card VRAM before it's drawn. Then each subsequent time, providing that the image hasn't been edited, it just draws straight from VRAM (no upload required) so it's faster.

My understanding of BMax was that it didn't need to do this (unless you are using pixmaps) because all the images are in VRAM anyway.


Images in Blitzmax are pixmaps too, internaly. the first time it's drawn an imageframe is created from the pixmap.
I use a function to build the imageframe after load the image.
Function ActiveImage(image:TImage)
	For Local _frame:Int=0 Until image.Frames.Length
		image.Seqs[_frame]=GraphicsSeq
		image.Frames[_frame]=_Max2DDriver.CreateFrameFromPixmap(image.Pixmaps[_frame],image.Flags)
	Next
EndFunction