DSpContext_SetState
You can use the DSpContext_SetState function to set the play state of a context.
OSStatus DSpContext_SetState ( DSpContextReference inContext, DSpContextState inState);
inContext
- A reference to the context whose play state you want to set.
- inState
- The state to set the context to. Valid input values
for this parameter arekDSpContextState_Active
,kDSpContextState_Paused
, andkDSpContextState_Inactive
.- function result
- A result code.
DESCRIPTION
The DSpContext_SetState function sets the play state of the context specified in theinContext
parameter to the state specified in the inState parameter. See "Play State" (page 2-25) for more information on valid values for the inPlayState parameter. In summary, you can make these choices:
- A context's initial play state is inactive. When all contexts for a display are set to
kDSpContextState_Inactive
, the display looks exactly as it does when the user is using their Macintosh normally: the monitor resolutions are set to the default, the menu bar is available, and so on.- Set the play state to
kDSpContextState_Active
to use the display. In this state, the attributes of the context are used to change the display resolution, remove the menu bar, and so on. When at least one context is active, all the display devices in the system are covered by a blanking window. When a context is in the active state, the display is completely owned by the game.- Set the play state to
kDSpContextState_Paused
to temporarily restore system adornments, while maintaining the attributes used by the context. This gives the user the opportunity to use the menus and switch to other applications. While the context is in the paused state, it is very important to callDSpProcessEvent
to allow DrawSprocket to correctly handle events such as suspend or resume (see theDSpProcessEvent
function on (page 2-72). Page flipping and double buffering are inactive in this state, and the context will be placed back at page 0 if page flipping was being used.
CALLING RESTRICTIONS
Do not call this function during an interrupt.