% DarkScreen.m % % opens a window using Psychtoolbox, % makes the window black, then white, and then closes % the window again % % written for Psychtoolbox 3 on the PC by IF 3/2007 ASR Verified that it % runs on MAC OSX 07/2007 screenNum=0; res=[1280 1024]; clrdepth=32; [wPtr,rect]=Screen('OpenWindow',screenNum,0,... [0 0 res(1) res(2)], clrdepth); black=BlackIndex(wPtr); white=WhiteIndex(wPtr); Screen('FillRect',wPtr,black); Screen(wPtr, 'Flip'); HideCursor; tic while toc<3 ; end Screen('FillRect',wPtr,white); Screen(wPtr, 'Flip'); HideCursor; tic while toc<3 ; end Screen('CloseAll'); ShowCursor