-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathclearTest.m
More file actions
40 lines (26 loc) · 877 Bytes
/
Copy pathclearTest.m
File metadata and controls
40 lines (26 loc) · 877 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
function clearTest
s = max(Screen('Screens'));
w = Screen('OpenWindow',s,BlackIndex(s));
white = WhiteIndex(w)*ones(1,3);
grey = .5*white;
scrRect = Screen('Rect', w); %left top right bottom
r = scrRect;
r([1 3]) = [100 200];
while ~KbCheck
Screen('FillRect', w, grey, r);
Screen('FillRect', w, white, r+200*[1 0 1 0]);
if rand > .9
%should only transiently grey the screen, then undone by flip's window clearing. but instead it is permanent once tripped!
k = scrRect;
rescue = false; %problem only occurs reliably when rect is full screen, otherwise it is nondeterministic
if rescue
k = k-[0 0 1 0];
end
Screen('FillRect',w,grey,k);
end
Screen('Flip',w,[],double(rand>.3));
WaitSecs(.5);
r = r + 10*[1 0 1 0];
end
Screen('CloseAll');
end