MPK uses attributes to specify certain properties for pipes, windows, and channels. In general, you can specify these attribute values in the following places:
Individual data structures
The MPKGlobal data structure (defaults only)
The configuration file
The SGI OpenGL Multipipe User's Guide describes how you specify the attributes in the configuration file. This appendix describes the attributes and how you specify them in the individual data structures and in the special MPKGlobal data structure. The following sections are included:
As described in the section “MPK Naming Conventions” in Chapter 2, MPK attribute names have three or more parts, the first two of which are the following:
MPK prefix
Attribute type
| CATTR | Specifies a channel attribute. | |
| PATTR | Specifies a pipe attribute. | |
| WATTR | Specifies a window attribute. | |
| DEFAULT | Used only in the case of the stereo-related attribute MPK_DEFAULT_EYE_OFFSET. |
The remaining parts contain additional attribute descriptors. The following are examples of attribute names:
MPK_CATTR_FAR MPK_PATTR_STEREO_WIDTH MPK_WATTR_HINTS_RGBA |
As cited in the introduction, you can programmatically manage the attributes in the individual data structures or in the MPKGlobal data structure. This section describes how you manage the attributes in the individual data structures, and the later section “MPKGlobal Attributes” describes how you do so from the MPKGlobal data structure.
The individual data structures of interest are the MPKChannel, MPKPipe, and MPKWindow data structures. The management of channel attributes is covered in the later section “MPKGlobal Attributes”.
MPK provides the functions shown in Table A-1 to manage attributes in the MPKChannel, MPKPipe, and MPKWindow data structures.
Table A-1. Attribute-Managing Functions for Individual Data Structures
To set the attributes of a MPKChannel, MPKPipe, or MPKWindow data structure to their default values, MPK calls the function mpkChannelResetAttribute(channel, MPK_CATTR_ALL), mpkPipeResetAttribute( pipe, MPK_PATTR_ALL ) or mpkWindowResetAttribute( window, MPK_WATTR_ALL ) upon creation of the data structure.
Table A-2 describes the MPKPipe attributes.
Table A-3 describes the MPKWindow attributes.
Table A-3. MPKWindow Attributes
The MPKChannel attributes MPK_CATTR_NEAR and MPK_CATTR_FAR, described in “MPKGlobal Attributes”, are set using the function mpkChannelSetNearFar() . The remaining MPKChannel attributes, described in Table A-4, are set using the functions described in Table A-1.
Table A-4. MPKChannel Attributes
Attribute Name | Valid Values | Description |
|---|---|---|
Any GL format enum | Defines the default color format to be used by this channel when reading color images. The default value is GL_RGB. See the glReadPixels man page for a list of supported values. | |
Any GL type enum | Defines the default color type to be used by this channel when reading color images. The default value is GL_UNSIGNED_BYTE. See the glReadPixels man page for a list of supported values. | |
Any GL format enum | Defines the default depth
format to be used by this
channel when reading color
images. The default value is
GL_DEPTH_COMPONENT24_ | |
Any GL type enum | Defines the default depth type to be used by this channel when reading color images. The default value is GL_UNSIGNED_INT on VPro, else GL_FLOAT. See the glReadPixels man page for a list of supported values. | |
Any GL format enum | Defines the default stencil format to be used by this channel when reading color images. The default value is GL_STENCIL_INDEX. See the glReadPixels man page for a list of supported values. | |
Any GL type enum | Defines the default stencil type to be used by this channel when reading color images. The default value is GL_UNSIGNED_BYTE. See the glReadPixels man page for a list of supported values. |
The MPKGlobal data structure allows you to specify attribute defaults for pipes, windows, and channels. Some attributes—for example, the default eye offset—can only be specified at the MPKGlobal data structure level.
MPK provides MPKGlobal functions to manage the attributes for the various data structures. The function names have the following five parts:
The mpkGlobal prefix
The operation Set or Get
The data structure type (Pipe, Window, or Channel)
The word Attribute
A suffix to determine the data type of the attribute
The following are examples:
void mpkGlobalSetPipeAttributei(int pattr, int val); float mpkGlobalGetChannelAttributef(int cattr); |
Accessing an unset variable will either return MPK_UNDEFINED or the default value of this variable.
Table A-5 describes the MPKGlobal attributes not included in the prior sections “MPKPipe Attributes” and “MPKWindow Attributes”.
Table A-5. MPK Global Attributes