Flush multiple background assets (and their assigned texture pages) from memory.



Argument Description
array Array with the background indices to flush

Returns: N/A


With this function you can remove any number of background textures - and the texture pages they are assigned to - from video memory (their texture pages will be reloaded on next use of any background from them). You supply an array of background asset indices and they will be removed from memory when the function is called. It is worth noting that by default on the Windows platforms (YYC and standard) all textures will always be loaded into memory on start-up. 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 and just not do anything. However you can also force the Windows target to not load any textures on startup and so use the flush and prefetch functions as you would on all other platforms (the setting can be found in the Windows Global Game Settings window).


bck_a[0] = bck_Trees;
bck_a[1] = bck_Clouds;
bck_a[2] = bck_Mountains;
bck_a[3] = bck_Tileset;

The above code creates an array where each element holds a background index. This array is then used to clear those background textures from memory.

Back: Backgrounds
Next: background_prefetch
© Copyright YoYo Games Ltd. 2018 All Rights Reserved