~ubuntu-branches/ubuntu/trusty/psychtoolbox-3/trusty-proposed

« back to all changes in this revision

Viewing changes to Psychtoolbox/PsychDemos/PsychTutorials/GazeContingentTutorial.m

  • Committer: Package Import Robot
  • Author(s): Yaroslav Halchenko
  • Date: 2013-11-19 23:34:50 UTC
  • mfrom: (3.1.4 experimental)
  • Revision ID: package-import@ubuntu.com-20131119233450-f7nf92vb8qavjmk8
Tags: 3.0.11.20131017.dfsg1-3
Upload to unsable since fresh glew has arrived to sid!

Show diffs side-by-side

added added

removed removed

Lines of Context:
90
90
    [wW, wH]=WindowSize(w);
91
91
        % wW=wRect(3);
92
92
        % wH=wRect(4);
93
 
         if ix>wW | iy>wH
 
93
         if ix>wW || iy>wH
94
94
        disp('Image size exceeds screen size');
95
95
        disp('Image will be cropped');
96
96
    end
244
244
        end
245
245
        
246
246
        % We only redraw if gazepos. has changed:
247
 
        if (mx~=mxold | my~=myold)            
 
247
        if (mx~=mxold || my~=myold)            
248
248
            % Compute position and size of source- and destinationrect and
249
249
            % clip it, if necessary...
250
250
            myrect=[mx-ms my-ms mx+ms+1 my+ms+1]; % center dRect on current mouseposition
276
276
                % This is done by weighting each color value of each pixel
277
277
                % with the corresponding alpha-value in the backbuffer
278
278
                % (GL_DST_ALPHA).
279
 
                if mode == 1 | mode == 3
 
279
                if mode == 1 || mode == 3
280
280
                    Screen('BlendFunction', w, GL_DST_ALPHA, GL_ZERO);
281
281
                    Screen('DrawTexture', w, nonfoveatex, [], ctRect);
282
282
                end
286
286
                % done by weighting each color value with one minus the
287
287
                % corresponding alpha-value in the backbuffer
288
288
                % (GL_ONE_MINUS_DST_ALPHA).
289
 
                if mode == 2 | mode == 3
 
289
                if mode == 2 || mode == 3
290
290
                    Screen('BlendFunction', w, GL_ONE_MINUS_DST_ALPHA, GL_ONE);
291
291
                    Screen('DrawTexture', w, foveatex, sRect, dRect);
292
292
                end
335
335
        WaitSecs(0.001);
336
336
 
337
337
        % Abort demo on keypress our mouse-click:
338
 
        if KbCheck | find(buttons) % break out of loop
 
338
        if KbCheck || find(buttons) % break out of loop
339
339
            break;
340
340
        end;
341
341
    end;