Set the resolution of the screen. This is intended to be used in
programs that run psychophysical experiments, so SetResolution is
strict. It issues a fatal error unless it can provide exactly the
resolution you specified. (For lenience, look at NearestResolution.)
“screenNumber” is the screen number.
“width” and “height” are the desired dimensions in pixels.
“hz” is the desired refresh rate (default is current frame rate).
“pixelSize” 8, 16, 24, or 32 bits and defaults to current pixelSize.
Returns the current resolution as “oldRes”.
NOTE: Apple has all the new LCD screens return a frame rate of 0, so
we treat that value as a special case. A request for “hz” of NaN will
match only with a frame rate of 0.
NOTE: On Linux this only works as you’d expect if there is only one
video output connected to a Psychtoolbox screen / X-Screen. On a
setup with multiple outputs per screen, this will only change the
size of the framebuffer, but not the resolution of the actual displays!
Use Screen(‘ConfigureDisplay’, ‘Scanout’, …); to change settings on
such a multi-display per screen setup on Linux.
Originally written by Sabina Wolfson.