What happens here? LoadImage

BlitzMax Forums/BlitzMax Beginners Area/What happens here? LoadImage

Takuan(Posted 2005) [#1]
Mhh..

Type mouseCursor
Function update_mouse()
'Global mousebmp:timage
'If Not mousebmp Then
Global mousebmp=LoadImage(blabla)
End Function
EndType

If that function is called in a loop, shouldnt it load the same image again and again?
Dont hear any noise from my HD (bitmap is loaded and shows on screen).
Does BMax remember that theres already an image with that path assigned to the global?


Floyd(Posted 2005) [#2]
The operating system remembers recent disk accesses and may use this to 'read' from the drive.

And the drive itself has built-in RAM. The last HD I bought had 8MB of memory for its own internal cache.


marksibly(Posted 2005) [#3]
Hi,

Code that 'initializes' Globals (ie: the LoadImage) is only executed once, the first time it is encountered.


Takuan(Posted 2005) [#4]
Oh, nice, thanks to both:)