% Screen('Preference', 'Verbosity', 0); % Screen('Preference', 'SkipSyncTests',1); % Screen('Preference', 'VisualDebugLevel',0); try screen=0; [wPtr,rect]=Screen('OpenWindow',screen); HideCursor; black=BlackIndex(wPtr); white=WhiteIndex(wPtr); Screen('FillRect',wPtr,white); Screen(wPtr, 'Flip'); tic while toc<5 end path=pwd; picfolder='\FACES'; pathpic=[pwd picfolder]; file=dir(pathpic); % filebmp=dir([pathpic '\*.bmp']); for i=3:length(file) face{i-2} = imread([pathpic '\' file(i).name],'bmp'); textureIndex=Screen('MakeTexture', wPtr, face{i-2}); ret=Screen('PreloadTextures', wPtr, textureIndex); Screen('DrawTexture', wPtr, textureIndex ); Screen(wPtr, 'Flip'); tic while toc<2 end end Screen('FillRect',wPtr,white); Screen(wPtr, 'Flip'); tic while toc<5 end Screen('Close', wPtr); ShowCursor; catch Screen('CloseAll'); rethrow(lasterror) end