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
Changes from 1 commit
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
Next Next commit
Issue #199 Virtual framebuffer to reduce missed FillRect
k1o0 committed Sep 4, 2020

Verified

This commit was signed with the committer’s verified signature.
skitt Stephen Kitt
commit 04bb49c1f682b66a138bf16b0cd7032992db5894
14 changes: 12 additions & 2 deletions +hw/+ptb/Window.m
Original file line number Diff line number Diff line change
@@ -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)
@@ -283,8 +286,15 @@ 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"
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);