Skip to content

Commit 506605f

Browse files
committed
add comments
1 parent 32cd843 commit 506605f

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

devSandbox.m

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
%
77
% Here, a tutorial from https://peterscarfe.com/contrastgratingdemo.html is
88
% provided for illustrative purpose (notice that some vars' name are updated
9-
% to our code style).
9+
% to our code style). For your use, you will delete that part.
1010
%
1111
% It is composed of two parts:
1212
% - a fixed structure that will initialize and close PTB in 'debug mode'
@@ -20,11 +20,13 @@
2020
% github repo, therefore it should be easy to move everything in your experiment
2121
% scripts (see the template that is annexed in `cpp-lln-lab/CPP_PTB`)
2222

23-
23+
% Init the structure that will contain PTB setup
2424
cfg = struct;
2525

26+
% Set the PTB window background manually
2627
cfg.backgroundColor = [ 127 127 127 ];
2728

29+
% Init PTB, see the Sub-Functions below
2830
cfg = devSandbox_initPTB(cfg);
2931

3032
%%
@@ -58,13 +60,14 @@
5860
% -------------------------------------------------------------------------
5961
%%
6062

63+
% Catch the error and restore your computer for debugging
6164
try
6265

6366
%%
6467
% -------------------------------------------------------------------------
6568
% ------------------------------ PLAYGROUND -------------------------------
6669
% -------------------------------------------------------------------------
67-
% Define Half-Size of the grating image.
70+
% Define Half-Size of the grating image.
6871
texsize = gratingSizePix / 2;
6972

7073
% First we compute pixels per cycle rounded to the nearest pixel
@@ -150,6 +153,7 @@
150153
% -------------------------------------------------------------------------
151154
%%
152155

156+
% Close PTB, see the Sub-Functions below
153157
devSandbox_cleanUp
154158

155159
catch
@@ -162,11 +166,15 @@
162166

163167
end
164168

165-
169+
%% Sub-Functions
166170
function cfg = devSandbox_initPTB(cfg)
167171

172+
% Shorter version of `initPTB.m`
173+
174+
% Skip the PTB sync test
168175
Screen('Preference', 'SkipSyncTests', 2);
169176

177+
% Open a transparent window
170178
PsychDebugWindowConfiguration
171179

172180
% Here we call some default settings for setting up Psychtoolbox

0 commit comments

Comments
 (0)