The prefetching works like this: a list of assets is provided, and in each main loop iteration, the engine opens and loads a single one into memory (an unordered map of shared pointers). It would be more effective in a longer game, where as the player moves, the assets are already being prepared for use.
There’s also a mechanism to collect and remove unused assets from memory.
What I really wanted was to load the textures in a separate thread, but 10 years ago, when I tried it, I didn’t get good results. Maybe now things are different.
There’s also a mechanism to collect and remove unused assets from memory.