Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions +hw/+ptb/Window.m
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@
% When true test synchronization to retrace upon open. Defaults to
% global preference (usually true). See 'Screen SkipSyncTests?'
PtbSyncTests
% When on, the PsychImaging pipeline is activated and a virtual
% framebuffer is used
VirtualFramebuffer matlab.lang.OnOffSwitchState = 'off'
end

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

% setup screen window
obj.PtbHandle = Screen('OpenWindow', obj.ScreenNum, obj.BackgroundColour,...
obj.OpenBounds, obj.PxDepth);
if obj.VirtualFramebuffer == "on"
% Enable imaging pipeline and virtual framebuffer
PsychImaging('PrepareConfiguration');
PsychImaging('AddTask', 'General', 'UseVirtualFramebuffer');
obj.PtbHandle = PsychImaging('OpenWindow', ...
obj.ScreenNum, obj.BackgroundColour, obj.OpenBounds, obj.PxDepth);
else
obj.PtbHandle = Screen('OpenWindow', ...
obj.ScreenNum, obj.BackgroundColour, obj.OpenBounds, obj.PxDepth);
end
obj.PxDepth = Screen('PixelSize', obj.PtbHandle);
obj.Bounds = Screen('Rect', obj.PtbHandle);

Expand Down
2 changes: 1 addition & 1 deletion alyx-matlab