Skip to content

Commit 751dc67

Browse files
committed
add dot texture function
1 parent 99d0977 commit 751dc67

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

dotTexture.m

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
function cfg = dotTexture(action, cfg, thisEvent)
2+
3+
switch action
4+
5+
case 'init'
6+
cfg.dot.texture = Screen('MakeTexture', cfg.screen.win, ...
7+
cfg.color.background(1) * ones(cfg.screen.winRect([4 3])));
8+
9+
case 'make'
10+
11+
Screen('FillRect', cfg.dot.texture, cfg.color.background);
12+
Screen('DrawDots', cfg.dot.texture, ...
13+
thisEvent.dot.position, ...
14+
cfg.dot.sizePix, ...
15+
cfg.dot.color, ...
16+
cfg.screen.center, ...
17+
1);
18+
19+
case 'draw'
20+
21+
Screen('DrawTexture', cfg.screen.win, cfg.dot.texture);
22+
23+
24+
end
25+
26+
end

0 commit comments

Comments
 (0)