dontclear in flip command

Hi

Im trying to draw squares with a temporal frequency of say 10 Hz without clearing the screen.
I get incremental drawing of images (so that works), but not at the frequency I want (it's much slower).

I use something like:

tf = 10;
while 1

...

Screen('FillRect', w,RGB,squareRect);
t0 = Screen('Flip', w,t0+(1/tf),1);
end

Can anyone help?
Jap. Also read through the pdf's in the PsychDocumentation folder for timing tips.

If it is really much slower then it is likely a graphics driver bug.

Try replacing in your code:

PsychImaging('PrepareConfiguration');
PsychImaging('AddTask', 'General', 'UseVirtualFramebuffer');
win = PsychImaging('OpenWindow', ....);

instead of

win = Screen('OpenWindow', ....);

This switches to a different implementation, which should allow to circumvent the graphics driver bug - and it is more efficient for the dontclear=1 mode anyway.

-mario


--- In psychtoolbox@yahoogroups.com, "xrli2002" <xrli2002@...> wrote:
>
> If it is much slower, something may go wrong. But you need do something like this to avoid single framae delay:
> hz=Screen('NominalFrameRate',w);
> interval=1/tf-1/hz/2; % interval with half frame shorter
>
> Then in the loop:
>
> t0 = Screen('Flip', w, t0+interval, 1);
>
> -Xiangrui
>
> --- In psychtoolbox@yahoogroups.com, "Chris" <chrispaffen@> wrote:
> >
> > Hi
> >
> > Im trying to draw squares with a temporal frequency of say 10 Hz without clearing the screen.
> > I get incremental drawing of images (so that works), but not at the frequency I want (it's much slower).
> >
> > I use something like:
> >
> > tf = 10;
> > while 1
> >
> > ...
> >
> > Screen('FillRect', w,RGB,squareRect);
> > t0 = Screen('Flip', w,t0+(1/tf),1);
> > end
> >
> > Can anyone help?
> >
>