Skip to content

Commit 98c3959

Browse files
committed
Merge remote-tracking branch 'origin/VirtualFrameBuffer' into dev
2 parents ab46500 + d55b738 commit 98c3959

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

+hw/+ptb/Window.m

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,9 @@
4949
% When true test synchronization to retrace upon open. Defaults to
5050
% global preference (usually true). See 'Screen SkipSyncTests?'
5151
PtbSyncTests
52+
% When on, the PsychImaging pipeline is activated and a virtual
53+
% framebuffer is used
54+
VirtualFramebuffer matlab.lang.OnOffSwitchState = 'off'
5255
end
5356

5457
properties (SetAccess = protected)
@@ -283,8 +286,16 @@ function open(obj)
283286
% Perhaps this shouldn't be set after setting 'Verbosity'?
284287

285288
% setup screen window
286-
obj.PtbHandle = Screen('OpenWindow', obj.ScreenNum, obj.BackgroundColour,...
287-
obj.OpenBounds, obj.PxDepth);
289+
if obj.VirtualFramebuffer == "on"
290+
% Enable imaging pipeline and virtual framebuffer
291+
PsychImaging('PrepareConfiguration');
292+
PsychImaging('AddTask', 'General', 'UseVirtualFramebuffer');
293+
obj.PtbHandle = PsychImaging('OpenWindow', ...
294+
obj.ScreenNum, obj.BackgroundColour, obj.OpenBounds, obj.PxDepth);
295+
else
296+
obj.PtbHandle = Screen('OpenWindow', ...
297+
obj.ScreenNum, obj.BackgroundColour, obj.OpenBounds, obj.PxDepth);
298+
end
288299
obj.PxDepth = Screen('PixelSize', obj.PtbHandle);
289300
obj.Bounds = Screen('Rect', obj.PtbHandle);
290301

0 commit comments

Comments
 (0)