Is there a way to quickly close all open textures without closing the screen?
I noticed that there is not a CloseAllTextures screen command.
I am trying to present multiple unique animations in a row and am quickly building up
thousands of textures (and exceeding the current limit). I'd like to clear the previous
textures before starting each new animation without closing the screen. Looping through
so many individual 'Close' commands is very slow.
Thanks a lot,
Does closing texture increase the efficiency of the code?
I have 20 images. I load them, make the corresponding textures, and draw these textures at various points in my study. I do not close a texture after Screen(‘Flip’), because I will present the same texture later on in the study. Does this slow down my script?
I checked the values returned by Screen(‘Flip’), e.g. VBLTimestamp, FlipTimestamp, Missed, etc. All looks fine, except for the random missed flips (if any). However, I may be missing something when it comes to closing textures, and I wanted to get your views on it.
Thanks a lot,
In your case, no. 20 textures don’t use much memory, doing what you do is most efficient.
If you had many textures that you don’t reuse across trials, or similar, that could become a problem. Essentially when you have so many textures that the machine runs out of graphics memory and then slows down or malfunctions due to out of memory / low memory conditions.
E.g., creating 10 new textures every trial and not closing them at the end of a trial could cause a slow down as the experiment progresses into hundreds of trials. Or movie playback at 30 fps == 30 new textures every second of playback if you don’t close each movie texture after drawing it - that can suck up Gigabytes of RAM and spell trouble quickly.