|
1 | 1 | function [cfg] = initPTB(cfg) |
2 | | -% This seems a good candidate function to have as a common function across |
3 | | -% experiments |
4 | | -% We might want to add a couple of IF in case the experiment does not use |
5 | | -% audio for example. |
| 2 | +% This will initialize PsychToolBox |
| 3 | +% - screen |
| 4 | +% - the windon opened takes the whole screen by default |
| 5 | +% - set in debug mode with window transparency if necessary |
| 6 | +% - can skip synch test if you ask for it (nicely) |
| 7 | +% - gets the flip interval |
| 8 | +% - computes the pixel per degree of visual angle |
| 9 | +% - set font details |
| 10 | +% - keyboard |
| 11 | +% - sound |
| 12 | + |
| 13 | + |
| 14 | +% TO DO |
| 15 | +% - We might want to add a couple of IF in case the experiment does not use audio for example. |
| 16 | +% - the computation for ppd assumes the windows takes the whole screenDistance |
| 17 | +% - refactor the window opening section (pass the window size as argument) |
6 | 18 |
|
7 | 19 | checkDependencies() |
8 | 20 |
|
|
57 | 69 |
|
58 | 70 | % init PTB with different options in concordance to the Debug Parameters |
59 | 71 | if cfg.debug |
60 | | - |
| 72 | + |
61 | 73 | % set to one because we don not care about time |
62 | 74 | Screen('Preference', 'SkipSyncTests', 2); |
63 | 75 | Screen('Preference', 'Verbosity', 0); |
64 | 76 | Screen('Preferences', 'SuppressAllWarnings', 2); |
65 | | - |
| 77 | + |
66 | 78 | if cfg.testingSmallScreen |
67 | 79 | [cfg.win, cfg.winRect] = PsychImaging('OpenWindow', cfg.screen, cfg.backgroundColor, [0,0, 480, 270]); |
68 | 80 | else |
|
71 | 83 | end |
72 | 84 | [cfg.win, cfg.winRect] = PsychImaging('OpenWindow', cfg.screen, cfg.backgroundColor); |
73 | 85 | end |
74 | | - |
| 86 | + |
75 | 87 | else |
76 | 88 | Screen('Preference','SkipSyncTests', 0); |
77 | 89 | [cfg.win, cfg.winRect] = PsychImaging('OpenWindow', cfg.screen, cfg.backgroundColor); |
78 | | - |
| 90 | + |
79 | 91 | end |
80 | 92 |
|
81 | 93 |
|
|
0 commit comments