Skip to content

Commit 81521c0

Browse files
Merge pull request #26 from marcobarilari/marco_screen-open-w
update how PTB opens a window to the easiest way
2 parents 15dfa9f + 167acf7 commit 81521c0

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

initPTB.m

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,8 @@
6161

6262
%% Visual
6363

64-
cfg.screen = max(Screen('Screens')); % Main screen
65-
66-
% Open a fullscreen, onscreen window with gray background. Enable 32bpc
67-
% floating point framebuffer via imaging pipeline on it.
68-
PsychImaging('PrepareConfiguration');
64+
% Get the screen numbers and draw to the external screen if avaliable
65+
cfg.screen = max(Screen('Screens'));
6966

7067
% init PTB with different options in concordance to the Debug Parameters
7168
if cfg.debug
@@ -76,17 +73,17 @@
7673
Screen('Preferences', 'SuppressAllWarnings', 2);
7774

7875
if cfg.testingSmallScreen
79-
[cfg.win, cfg.winRect] = PsychImaging('OpenWindow', cfg.screen, cfg.backgroundColor, [0,0, 480, 270]);
76+
[cfg.win, cfg.winRect] = Screen('OpenWindow', cfg.screen, cfg.backgroundColor, [0,0, 480, 270]);
8077
else
8178
if cfg.testingTranspScreen
8279
PsychDebugWindowConfiguration
8380
end
84-
[cfg.win, cfg.winRect] = PsychImaging('OpenWindow', cfg.screen, cfg.backgroundColor);
81+
[cfg.win, cfg.winRect] = Screen('OpenWindow', cfg.screen, cfg.backgroundColor);
8582
end
8683

8784
else
8885
Screen('Preference','SkipSyncTests', 0);
89-
[cfg.win, cfg.winRect] = PsychImaging('OpenWindow', cfg.screen, cfg.backgroundColor);
86+
[cfg.win, cfg.winRect] = Screen('OpenWindow', cfg.screen, cfg.backgroundColor);
9087

9188
end
9289

0 commit comments

Comments
 (0)