GetNextResolution (csCode = 17)
The required
GetNextResolution
routine reports all display resolutions that the driver supports.
OSErr = Status(theDeviceRefNum, cscGetNextResolution, &theVDResolutionInfoRec);
-
--> csPreviousDisplayModeID
-
ID of the previous display mode
-
<-- csDisplayModeID
-
ID of the display mode following csPreviousDisplayModeID.
-
<-- csHorizontalPixels
-
Number of pixels in a horizontal line
-
<-- csVerticalLines
-
Number of lines in a screen
-
<-- csRefreshRate
-
Vertical refresh rate of the screen
-
<-- csMaxDepthMode
-
Max relative bit depth for this
DisplayModeID
GetNextResolution
passes a
csPreviousDisplayModeID
value and returns the next supported display mode. The
csDisplayModeID
field is updated and the
csHorizontalPixels,
csVerticalLines, and
csRefreshRate
fields are set. The
csMaxDepthMode
field is also set with the highest supported video bit depth. This uses the same convention as in the past;
kDepthMode1
is the first relative bit depth supported, not necessarily 1 bit per pixel. For futher information about depth modes, see the next section.
Observe these cautions:
-
The
DisplayModeID
values used do not need to be the same as the ones Apple uses. However, the
DisplayModeID
value 0 and all values with the high bit set (0x80000000 through 0xFFFFFFFF) are reserved by Apple.
-
To get the first resolution supported by a display, the caller will pass a value of
kDisplayModeIDFindFirstResolution
in the
csPreviousDisplayModeID
field of the
VDResolutionInfoRec
structure.
-
To get the second resolution, the caller will pass the
csDisplayModeID
value of the first resolution in the structure's
csPreviousDisplayModeID
field.
-
When a call has the last supported resolution in the
csPreviousDisplayModeID
field, the driver should return a value of
kDisplayModeIDNoMoreResolutions
in the
csDisplayModeID
field. No error should be returned.
-
If an invalid value is passed in the
csPreviousDisplayModeID
field, the driver should return a
paramErr
value without modifying the structure.
-
If the
csPreviousDisplayModeID
field is
kDisplayModeIDCurrent, the driver should return information about the current
displayModeID.
The constants just described are defined in the file
Video.h
and are listed in
Data Structures.
© 1999 Apple Computer, Inc. (Last Updated 26 March 99)