the relationship between PsychToolBox and DirectX

Hello all,

I'm using Psychtoolbox 2.54 and Matlab 7, with OS Windows XP
Professional.
I've created an 8 sec movie of a ball moving, by defining each frame
of the movie beforehand, and then running them all together using
Rush.
Here's part of my code:
==================================================

loop = {
'Screen(get(test,''window''),''WaitBlanking'');'
'Screen(get(test,''window''),''WaitBlanking'',prescreens);'

'for i=1:totalFrames;'
'Screen(get(test,''window''),''WaitBlanking'');'
'Screen(get(test,''window''),''FillRect'',background);'
'Screen(get(test,''window''),''FillOval'',stimulusColor
(i),r{i});'
'end;'
};

priorityLevel = MaxPriority(test.screenNumber,'WaitBlanking');
Screen('Screens');
Screen(test.window,'WaitBlanking',prescreens);
Rush(loop,priorityLevel);
============================================================

However at about the 5th trial (=block), the program crushes (not
before the screen and the ball, which were black & white, change
their colors to green and pink...) and the following message appears
on matlab window:

====================================================

??? Error during RUSH: Restore failed to restore the Direct Draw
Surface

Error in ==> Test.presentVisualMovie at 497
Rush(loop,priorityLevel);

Error in ==> Test.EvokeStimulus at 246
presentVisualMovie(test,block,stimulus);

??? Error while evaluating uicontrol Callback.


==========================================================

Does anyone knows what causes the call to Restore method of
directDraw surface?
I know DirectDraw is a java class belongs to DirectX, but I don't
know What are the relations between PsychToolBox and DirectX…

many thanks in advance,
Hanna
Hi Mario,
thanks for your fast reply.
I've dowloaded the beta version of PTB as you've suggested,
and the program indeed doesn't crash anymore!
thanks! :)
however, there's a small problem with the new version:
in my program, before running the visual movie, I'm asking matlab to
pause for 10 sec using:

pause(10);

during this time the screen appears with blue color! (although the
background was defined to black)

any suggestions what should I fix here?

many mnay thanks
Hanna





--- In psychtoolbox@yahoogroups.com, "Mario Kleiner"
<mario.kleiner@...> wrote:
>
> Hi Hanna,
>
> the old Windows PTB uses DirectDraw/DirectX for stimulus display. I
> don't know why you experience this error condition, probably a bug
in
> PTB or in DirectX, but in case you get stuck on it, you may want
give
> the beta version of the new OpenGL Psychtoolbox for Windows a try.
It
> contains a compatibility mode that allows to emulate a (small)
subset
> of old PTB's behaviour... It's a new experimental feature but on
the
> code tested so far in our lab, it works reasonably well in most
cases,
> so it may work on your code...
>
> Just follow the instructions in:
>
> <https://lists.berlios.de/pipermail/osxptb-announce/2006-
January/000004.html>
>
> good luck,
> -mario
>
>
> --- In psychtoolbox@yahoogroups.com, "hanna_zahar" <hanna_zahar@>
> wrote:
> >
> > Hello all,
> >
> > I'm using Psychtoolbox 2.54 and Matlab 7, with OS Windows XP
> > Professional.
> > I've created an 8 sec movie of a ball moving, by defining each
frame
> > of the movie beforehand, and then running them all together
using
> > Rush.
> > Here's part of my code:
> > ==================================================
> >
> > loop = {
> > 'Screen(get(test,''window''),''WaitBlanking'');'
> > 'Screen(get
(test,''window''),''WaitBlanking'',prescreens);'
> >
> > 'for i=1:totalFrames;'
> > 'Screen(get(test,''window''),''WaitBlanking'');'
> > 'Screen(get
(test,''window''),''FillRect'',background);'
> > 'Screen(get
(test,''window''),''FillOval'',stimulusColor
> > (i),r{i});'
> > 'end;'
> > };
> >
> > priorityLevel = MaxPriority(test.screenNumber,'WaitBlanking');
> > Screen('Screens');
> > Screen(test.window,'WaitBlanking',prescreens);
> > Rush(loop,priorityLevel);
> > ============================================================
> >
> > However at about the 5th trial (=block), the program crushes
(not
> > before the screen and the ball, which were black & white, change
> > their colors to green and pink...) and the following message
appears
> > on matlab window:
> >
> > ====================================================
> >
> > ??? Error during RUSH: Restore failed to restore the Direct Draw
> > Surface
> >
> > Error in ==> Test.presentVisualMovie at 497
> > Rush(loop,priorityLevel);
> >
> > Error in ==> Test.EvokeStimulus at 246
> > presentVisualMovie(test,block,stimulus);
> >
> > ??? Error while evaluating uicontrol Callback.
> >
> >
> > ==========================================================
> >
> > Does anyone knows what causes the call to Restore method of
> > directDraw surface?
> > I know DirectDraw is a java class belongs to DirectX, but I
don't
> > know What are the relations between PsychToolBox and DirectX…
> >
> > many thanks in advance,
> > Hanna
> >
>