Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Virtual frame buffer #306

Open
wants to merge 2 commits into
base: v2.6
Choose a base branch
from
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