function flickerPairs_PTB_3_46_4_small Screen('Preference','DebugMakeTexture', 1); filename = 'cb_file_test_long.txt'; % filename = 'cb_6_18_07_PTB3_format.txt'; [timeout img1 img1_secs img2 img2_secs img3 img3_secs img4 img4_secs]=textread(filename,'%f %s %f %s %f %s %f %s %f', 'delimiter', ','); [w,rect]=Screen('OpenWindow',0,[128 128 128]); % % establish screen center % x0 = rect(3)/2; % x = width (512) % y0 = rect(4)/2; % y = height (384) num_trials = length(timeout); escPressed = false; for index = 1:num_trials pic1=imread(char(img1(index))); pic2=imread(char(img3(index))); div=imread(char(img2(index))); trialStartSecs = GetSecs(); Priority(1); while (~escPressed && (GetSecs() < trialStartSecs + timeout(index))) imgStart = GetSecs(); t=Screen('MakeTexture',w,pic1); Screen('DrawTexture',w,t,[]); Screen('Flip', w); while (~escPressed && (GetSecs() < imgStart + img1_secs(index))) [keyIsDown, secs, keyCode] = KbCheck(); if keyCode(27) escPressed = 1; end WaitSecs(0.01); end imgStart = GetSecs(); t=Screen('MakeTexture',w,div); Screen('DrawTexture',w,t,[]); Screen('Flip',w); while (~escPressed && (GetSecs() < imgStart + img2_secs(index))) [keyIsDown, secs, keyCode] = KbCheck(); if keyCode(27) escPressed = 1; end WaitSecs(0.01); end imgStart = GetSecs(); t=Screen('MakeTexture',w,pic2); Screen('DrawTexture',w,t,[]); Screen('Flip', w); while (~escPressed && (GetSecs() < imgStart + img3_secs(index))) [keyIsDown, secs, keyCode] = KbCheck(); if keyCode(27) escPressed = 1; end WaitSecs(0.01); end imgStart = GetSecs(); t=Screen('MakeTexture',w,div); Screen('DrawTexture',w,t,[]); Screen('Flip',w); while (~escPressed && (GetSecs() < imgStart + img2_secs(index))) [keyIsDown, secs, keyCode] = KbCheck(); if keyCode(27) escPressed = 1; end WaitSecs(0.01); end % buttons = 0; % while ~any(buttons) % wait for press % [x,y,buttons] = GetMouse; % % Wait 10 ms before checking the mouse again to prevent % % overload of the machine at elevated Priority() % WaitSecs(0.01); % end end end Priority(0); fclose('all'); Screen('CloseAll'); end