No Revisions Have Been Made To This Page
Can you suggest an edit for this page? Click Here
GML Code Example
With this function you can remove all textures from video
memory, and they will then be reloaded on first use. This is the
only effective way to manage video memory when you have multiple
texture pages for a game, and you should flush the texture memory
between levels on your game and organise the graphics using the
texture group feature to ensure that the minimum number of textures
It is worth noting that this function works on all target platforms except for Windows (YYC and standard), since the Directx graphics pipeline handles things differently, meaning that all textures will always be loaded into memory on start-up for these targets. If you are making a cross platform game, then you can leave this function in your code for the Windows target as it will not give any error, but rather silently fail.
NOTE: There is a performance hit as the texture is uploaded to texture memory on most devices, so the best idea is to do a dummy render of the required graphics at the start of a level to avoid any stalls. You would only need to render a single graphic from each texture page to ensure that texture is loaded, and you should be aware that texture groups can have more than one texture page which means that each load will cause a stall.