File: TextureChannelsTest.m

package info (click to toggle)
psychtoolbox-3 3.0.19.14.dfsg1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 86,796 kB
  • sloc: ansic: 176,245; cpp: 20,103; objc: 5,393; sh: 2,753; python: 1,397; php: 384; makefile: 193; java: 113
file content (32 lines) | stat: -rw-r--r-- 836 bytes parent folder | download | duplicates (7)
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 TextureChannelsTest
% TextureChannelsTest
%
% Test proper assignment of matrix layers to RGBA texture channels.
%
% What you should see during the test:
%
% 1. A red square on a black background. Keypress!
% 2. A green square on a black background. Keypress!
% 3. A blue square on a black background. Keypress!
% 4. A black screen. Keypress!
% End.
%
% If you see different colors in different order, then
% something in the RGBA path of Screen('MakeTexture') is
% broken, e.g., due to some machine endian issue.
%

% 29.05.2006 Written (MK).

win = Screen('OpenWindow', 0, 0);
for nr=1:4
    img = zeros(256, 256, 4);
    img(:,:,nr)=ones(256,256)*255;
    tex = Screen('MakeTexture', win, img);
    Screen('DrawTexture', win, tex);
    Screen('Flip',win);
    KbWait;
    while KbCheck; end;
end;
Screen('CloseAll');
return;