Quote: "...but I'm talking about in LARGE games where there are many images loaded at the same time."
Well, what size exactly are we talking about? In your second post you say:
Quote: "All of mine are quite small. The largest of them is 1024x768..."
So I don't understand. I load a bunch of 4096x4096 images in my project, and it is true that sometimes they do not load because of the size, depending on the hardware.
Although this doesn't happen to me during the initial loading, but afterwards, when the images have been loaded and unloaded several times, like if the video ram memory got fragmented, and the large texture didn't fit.
There are several workarounds to cover this:
- Load without mipmaps. This will greatly reduce the amount of memory being used, and textures will load faster. Just set to '1' the 'texture flag' of LOAD IMAGE:
rem LOAD IMAGE Filename, Image Number, Texture Flag, Divide Texture Size
LOAD IMAGE "IMAGES\TEMP.BMP", 1, 1
- Ask for IMAGE EXIST after loading. If the image didn't fit into memory, IMAGE EXIST will return 0. Then you can take the appropiate actions so that your sprite/object doesn't appear white.
For example, you can try to load a lower resolution texture, if you have one prepared within your media.
But you can also use the third parameter of LOAD IMAGE, that is 'Divide Texture Size'. A value greater than zero will divide the size of the texture to reduce the memory required to hold the texture in memory.
This allows to reduce texture size at run time, so you can re-try to load the image until it fits into memory. This will load the largest texture allowed by the hardware.
Maybe not the best solution, but your software won't look that 'unprofessional'.
Quote: "And it seems to be exclusively with PNGs."
Do you use other formats that verify this info? I think it will happen regardless of the file format.