Premade Windows Screen
Open an offscreen window. This is simply an OpenGL texture that is treated as a
window, so you can draw to it. Offscreen windows should be used to keep old code
from OS-9 Psychtoolbox working, or if you need an offscreen drawing canvas for
fast drawing, that you can later use as a texture. For quickly displaying
premade Matlab image matrices, use the 'MakeTexture' command instead. It allow
for significantly higher drawing speeds.
You can specify a screen (any windowPtr or a screenNumber>=0) or no
screen(screenNumber=-1), but any real screen must already have an open Screen
window when you call OpenOffscreenWindow.
"color" is the clut index (scalar or [r g b] triplet or [r g b a] quadruple)
that you want to poke into each pixel as initial background color; default is
white.
"rect" specifies the size of the offscreen window If supplied, "rect" must
contain at least one pixel. If a windowPtr is supplied, then "rect" defaults to
the whole window. If a screenNumber is supplied then "rect" defaults to the
whole screen. If a screenNumber of -1 is supplied, then "rect" defaults to the
size of the main screen. (In all cases, subsequent references to this new
offscreen window will use its coordinates: origin at its upper left.)
"pixelSize" sets the depth (in bits) of each pixel. If you specify no screen
(screenNumber=-1) then the default pixelSize is 32, but you can specify any
legal depth: 8, 16, 24, 32. A pixelSize of 0 or is replaced by the default of
32 bits per pixel. If you specify a screen number of windowPtr, then the default
depth is that of the screen or window. If you run your script with the imaging
pipeline enabled (imagingmode flag > 0 in Screen('OpenWindow'), then all
Offscreen windows always have 4 color channels RGBA and the selectable depths
are additionally 64 bits or 128 bits, corresponding to 16 bits or 32 bits
floating point precision per color component. If 64 bits are selected but the
hardware does not support this in float precision, a 15 bit precision per color
channel signed integer format will be tried instead. On OpenGL-ES hardware, only
the 32 bpc float type or 8 bit integer type is supported, therefore a pixelSize
of more than 32 will always get silently upgraded to 128 bits per pixel, if
possible.