# SCREEN Resolutions enhanced

**URL:** <https://psychtoolbox.discourse.group/t/screen-resolutions-enhanced/1515>\
**Category:** Uncategorized\
**Created:** [April 11, 2002, 9:52am UTC](https://psychtoolbox.discourse.group/t/screen-resolutions-enhanced/1515 "2002-04-11T09:52:54Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![denispelli](https://avatars.discourse-cdn.com/v4/letter/d/cdc98d/32.png) [@denispelli](https://psychtoolbox.discourse.group/u/denispelli)\
**Post date:** [April 11, 2002, 9:52am UTC](https://psychtoolbox.discourse.group/t/screen-resolutions-enhanced/1515/1 "2002-04-11T09:52:54Z")

</div>

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](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@...](mailto: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.

---

<div class="post-metadata">

**Author:** ![f88zp](https://avatars.discourse-cdn.com/v4/letter/f/a3d4f5/32.png) [@f88zp](https://psychtoolbox.discourse.group/u/f88zp)\
**Post date:** [April 26, 2002, 11:14am UTC](https://psychtoolbox.discourse.group/t/screen-resolutions-enhanced/1515/2 "2002-04-26T11:14:29Z")

</div>

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](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@...](mailto: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](http://psychtoolbox.org)  
> \> POST a message to: [psychtoolbox@yahoogroups.com](mailto:psychtoolbox@yahoogroups.com)  
> \> UNSUBSCRIBE by sending a blank message to:  
> \> [psychtoolbox-unsubscribe@yahoogroups.com](mailto:psychtoolbox-unsubscribe@yahoogroups.com)  
> \>  
> \> Your use of Yahoo! Groups is subject to   
> \> [http://docs.yahoo.com/info/terms/](http://docs.yahoo.com/info/terms/)  
> \>  
>    
> \>  
> \> This message has the following attachments:  
> \>  
> \> "SCREEN.mex" (missing)

---

<div class="post-metadata">

**Author:** ![denispelli](https://avatars.discourse-cdn.com/v4/letter/d/cdc98d/32.png) [@denispelli](https://psychtoolbox.discourse.group/u/denispelli)\
**Post date:** [April 26, 2002, 3:24pm UTC](https://psychtoolbox.discourse.group/t/screen-resolutions-enhanced/1515/3 "2002-04-26T15:24:51Z")

</div>

> \>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
