Previous Book Contents Book Index Next

Inside Macintosh: Apple Game Sprockets Guide /
Chapter 2 - DrawSprocket / DrawSprocket Reference
DrawSprocket Functions / Choosing a Context and Saving Preferences


DSpGetNextContext

You can use the DSpGetNextContext function to get the next context in a list of available contexts for a display. Use this function in conjunction with the DSpGetFirstContext function, which gets the first context in the list for a specified display.

OSStatus DSpGetNextContext (
DSpContextReference inCurrentContext,
DSpContextReference *outContext);
inCurrentContext
The context reference that was just returned by DSpGetFirstContext or DSpGetNextContext.
outContext
On exit, a reference to the next context in the list of available contexts.
function result
A result code.
DESCRIPTION
The DSpGetNextContext function takes, in the inCurrentContext parameter, a reference to a context in a list of contexts that are available for a display and returns, in the outContext parameter, a reference to the next context in the list. If inCurrentContext contains the last context in the list, DSpGetNextContext returns an error.

A sample use would be:

DSpContextReference theContext;
theError = DSpGetFirstContext(theDisplayID, &theContext);
/* process the error */
while (theContext)
{
   /* process the context */

   /* get the next context */
   theError = DSpGetNextContext(theContext, &theContext);
   /* process the error */
}
CALLING RESTRICTIONS
Do not call this function during an interrupt.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
2 JUL 1996