193
193
dots(:,1) = centeredDots(:,1) + xmid*ones(nDots,1);
194
194
dots(:,2) = centeredDots(:,2) + ymid*ones(nDots,1);
197
Screen('FillRect', scal.windowPtr, colorBlack);
199
% Reference texture assigned to draw as backdrop?
200
if isfield(scal, 'refTex')
201
% Seems so. Double-check and draw it, if ok:
203
Screen('DrawTexture', scal.windowPtr, scal.refTex, [], Screen('Rect', scal.refTex));
207
% Update dot diameters
208
% Set all dots to default diameter
210
dotDiamArray = zeros(size(dots,1), 1) + dotDiam;
211
xGlobalCalibDots = size(scal.XCALIBDOTS, 1);
212
xCurrDots = size(dots, 1);
213
if xGlobalCalibDots ~= dots
214
% Adjusting fitting dots, a center dot may not be selected.
215
% Draw a crosshair at the center instead.
216
%bvlDrawCrosshair(windowPtr, x, y [,size] [,color])
217
bvlDrawCrosshair(scal.windowPtr, xmax, ymax, selectedDotDiam * 2, dotColor);
219
% Make the center dot larger so user can line up with screen
221
indexCenterDot = round(length(dots(:,1)) / 2);
222
dotDiamArray(indexCenterDot) = selectedDotDiam;
227
Screen('DrawDots', scal.windowPtr, transpose(dots), dotDiamArray, dotColor, [0 0], dotStyle);
230
% Show help text if requested:
232
helptxt = ['GLOBAL MODE:\nFinish calibration by pressing ESCape key\nToggle help text by pressing SPACE key\nChange selected global parameters via Cursor arrow keys\n' ...
233
'Select global parameter change mode via right mouse button\nChange parameter step size via middle mouse button\n' ...
234
'Switch to local adjustment mode via left mouse button.\n'];
235
DrawFormattedText(scal.windowPtr, helptxt, 30, 30, [255 255 0]);
196
% Loop across stereo buffers
197
for view = 0:sign(scal.stereoMode)
198
Screen('SelectStereoDrawbuffer', scal.windowPtr, view);
201
Screen('FillRect', scal.windowPtr, colorBlack);
203
% Reference texture assigned to draw as backdrop?
204
if isfield(scal, 'refTex')
205
% Seems so. Double-check and draw it, if ok:
207
Screen('DrawTexture', scal.windowPtr, scal.refTex, [], Screen('Rect', scal.refTex));
211
% Update dot diameters
212
% Set all dots to default diameter
214
dotDiamArray = zeros(size(dots,1), 1) + dotDiam;
215
xGlobalCalibDots = size(scal.XCALIBDOTS, 1);
216
xCurrDots = size(dots, 1);
217
if xGlobalCalibDots ~= dots
218
% Adjusting fitting dots, a center dot may not be selected.
219
% Draw a crosshair at the center instead.
220
%bvlDrawCrosshair(windowPtr, x, y [,size] [,color])
221
bvlDrawCrosshair(scal.windowPtr, xmax, ymax, selectedDotDiam * 2, dotColor);
223
% Make the center dot larger so user can line up with screen
225
indexCenterDot = round(length(dots(:,1)) / 2);
226
dotDiamArray(indexCenterDot) = selectedDotDiam;
231
Screen('DrawDots', scal.windowPtr, transpose(dots), dotDiamArray, dotColor, [0 0], dotStyle);
234
% Show help text if requested:
236
helptxt = ['GLOBAL MODE:\nFinish calibration by pressing ESCape key\nToggle help text by pressing SPACE key\nChange selected global parameters via Cursor arrow keys\n' ...
237
'Select global parameter change mode via right mouse button\nChange parameter step size via middle mouse button\n' ...
238
'Switch to local adjustment mode via left mouse button.\n'];
239
DrawFormattedText(scal.windowPtr, helptxt, 30, 30, [255 255 0]);
239
243
% Check for input
240
244
if bMiddleMouseDown || bRightMouseDown