SCREEN Resolutions enhanced

Sabina Wolfson reported that SCREEN Resolutions, on the Mac, reported
fewer resolutions that did the popular shareware program SwitchRes. So,
we wrote to Stéphane Madrau, the author of SwitchRes, and asked for
advice. He suggested using cscGetNextResolution, to call the driver
directly, to produce a more complete list than is provided by only
calling the Mac OS Display Manager. We followed this advice and SCREEN
Resolution now lists ALL resolutions that the driver knows (some of which
won't work).

http://psychtoolbox.org/mac.html#changes

The new, enhanced SCREEN.mex is enclosed. This will be included in the
forthcoming release of Psychtoolbox version 2.5.

best

denis


NOTE TO ALL: denis.pelli@... is my preferred email address. Please
use that address. My "verizon.net" address will go away soon, partly
because Verizon forces me to use that as my "From:" address. My current
email program won't allow me to designate a separate "Reply-to:" address.
I have encountered problems with the recently updated SCREEN.mex. After
installing the new version I have not been able to run my old m-files. I
have included the relevant code from my m-file and the resulting error
message from the new screen.mex version. Everything works fine with the
old SCREEN.mex installed.

-----------------------------------------

m-file code:

% Set up main screen
cal = LoadCalFile(0);
[correctedTable,gammaValue] = compgamma(cal);
[window,windowRect] =
SCREEN(whichScreen,'OpenWindow',res.background,[],32);
RadeonSetGamma10(whichScreen,1023*cal.gammaTable);
SCREEN(window,'setclut',255*[cal.gammaTable(:,1).^(1/gammaValue(1)) ...
cal.gammaTable(:,2).^(1/gammaValue(2))
cal.gammaTable(:,3).^(1/gammaValue(3))]);
SCREEN(window,'FillRect',res.background);
HideCursor;
ScreenSaver(0);

% Open empty background offscreen window
emptyWindow =
SCREEN(whichScreen,'OpenOffscreenWindow',res.background,[],32);


error message:

??? SCREENOpenOffscreenWindow.c line 343: new offscreen window has
zero-length color table

Error in ==>
"MatlabToolboxPath":PsychToolbox:PsychBasic:SCREEN.mex
Error in ==>
"MatlabToolboxPath":PsychToolbox:PsychPersonal:perirestest.m
On line 74 ==>
emptyWindow =
SCREEN(whichScreen,'OpenOffscreenWindow',res.background,[],32);

-----------------------------------------

Any suggestions?

Many thanks in advance,
Zoran
____________________________

Zoran Popovic, M.Sc., Ph.D. student
Dept. of Ophthalmology
Goteborg University
43180 Molndal
Sweden

> Sabina Wolfson reported that SCREEN Resolutions, on the Mac, reported
> fewer resolutions that did the popular shareware program SwitchRes. So,
> we wrote to Stéphane Madrau, the author of SwitchRes, and asked for
> advice. He suggested using cscGetNextResolution, to call the driver
> directly, to produce a more complete list than is provided by only
> calling the Mac OS Display Manager. We followed this advice and SCREEN
> Resolution now lists ALL resolutions that the driver knows (some of
> which
> won't work).
>
> http://psychtoolbox.org/mac.html#changes
>
> The new, enhanced SCREEN.mex is enclosed. This will be included in the
> forthcoming release of Psychtoolbox version 2.5.
>
> best
>
> denis
>
>
> NOTE TO ALL: denis.pelli@... is my preferred email address. Please
> use that address. My "verizon.net" address will go away soon, partly
> because Verizon forces me to use that as my "From:" address. My current
> email program won't allow me to designate a separate "Reply-to:"
> address.
>
>
> http://psychtoolbox.org
> POST a message to: psychtoolbox@yahoogroups.com
> UNSUBSCRIBE by sending a blank message to:
> psychtoolbox-unsubscribe@yahoogroups.com
>
> Your use of Yahoo! Groups is subject to
> http://docs.yahoo.com/info/terms/
>

>
> This message has the following attachments:
>
> "SCREEN.mex" (missing)
>I have encountered problems with the recently updated SCREEN.mex.
>After installing the new version I have not been able to run my old
>m-files. I have included the relevant code from my m-file and the
>resulting error message from the new screen.mex version. Everything
>works fine with the old SCREEN.mex installed.
>
>-----------------------------------------
>
>m-file code:
>
>% Set up main screen
>cal = LoadCalFile(0);
>[correctedTable,gammaValue] = compgamma(cal);
>[window,windowRect] = SCREEN(whichScreen,'OpenWindow',res.background,[],32);
>RadeonSetGamma10(whichScreen,1023*cal.gammaTable);
>SCREEN(window,'setclut',255*[cal.gammaTable(:,1).^(1/gammaValue(1)) ...
>cal.gammaTable(:,2).^(1/gammaValue(2))
>cal.gammaTable(:,3).^(1/gammaValue(3))]);
>SCREEN(window,'FillRect',res.background);
>HideCursor;
>ScreenSaver(0);
>
>% Open empty background offscreen window
>emptyWindow = SCREEN(whichScreen,'OpenOffscreenWindow',res.background,[],32);
>
>
>error message:
>
>??? SCREENOpenOffscreenWindow.c line 343: new offscreen window has
>zero-length color table
>
>Error in ==>
>"MatlabToolboxPath":PsychToolbox:PsychBasic:SCREEN.mex
>Error in ==>
>"MatlabToolboxPath":PsychToolbox:PsychPersonal:perirestest.m
>On line 74 ==>
>emptyWindow = SCREEN(whichScreen,'OpenOffscreenWindow',res.background,[],32);
>
>-----------------------------------------
>
>Any suggestions?
>
>Many thanks in advance,
>Zoran
>____________________________
>
>Zoran Popovic, M.Sc., Ph.D. student
>Dept. of Ophthalmology
>Goteborg University
>43180 Molndal
>Sweden
>

dear zoran

thanks for the report. david brainard reports the same symptoms. i
have not been able to replicate david's report on any of my machines,
despite running the same version of the Mac OS. it's harder to fix
faults when they're not manifest. so your report helps.

we're looking into it and will report back soon.

best

denis