-
Notifications
You must be signed in to change notification settings - Fork 0
/
DrawAnnulus.m
33 lines (25 loc) · 1.08 KB
/
DrawAnnulus.m
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
function [ HW, stimStartTime ] = DrawAnnulus( HW, P )
%DRAWANNULUS Summary of this function goes here
% Detailed explanation goes here
% eyesToDraw, stimLuminance, bgLuminance, innerRadiusDeg, outerRadiusDeg
screenCenter = 0.5*(HW.screenRect([1 2]) + HW.screenRect([3 4]));
bgColorVal = HW.white * P.bgLuminance;
stimColorVal = HW.white * P.stimLuminance;
for eye = [0 1]
HW = ScreenCustomStereo(...
HW, 'SelectStereoDrawBuffer', HW.winPtr, eye);
Screen('FillRect', HW.winPtr, bgColorVal);
if any(eye == P.eyesToDraw)
Screen('gluDisk', HW.winPtr, stimColorVal, ...
screenCenter(1), screenCenter(2), P.outerRadiusDeg * HW.ppd);
Screen('gluDisk', HW.winPtr, bgColorVal, ...
screenCenter(1), screenCenter(2), P.innerRadiusDeg * HW.ppd);
end
end
if isfield(P, 'fixColor')
DrawFixationMark(HW, P.fixColor, P.fixWidthDeg, P.fixLineWidthPx);
end
% This stimStartTime timestamp isn't very accurate on Windows in
% multi-display mode, but is better than GetSecs()
[HW, stimStartTime] = ScreenCustomStereo(HW, 'Flip', HW.winPtr);
end