Previous Book Contents Book Index Next

Inside Macintosh: Apple Game Sprockets Guide /
Chapter 2 - DrawSprocket / DrawSprocket Reference
DrawSprocket Functions / Utility Functions


DSpContext_SetVBLProc

You can use the DSpContext_SetVBLProc function to piggyback your own VBL task to a particular context.

OSStatus DSpContext_SetVBLProc (
		DSpContextReference inContext,
		DSpCallbackProcPtr inProcPtr,
		void *inRefCon);
inContext
The context the VBL task is associated with.
inProcPtr
A pointer to an application-supplied callback function.
inRefCon
An reference constant to be handed back by DrawSprocket when it calls the inProcPtr callback.
function result
A result code.
DESCRIPTION
Because DrawSprocket needs to set up VBL tasks of its own, you can piggyback your own VBL task to a particular context easily with this function, instead of digging down through the system to find the correct slot ID and installing your own. Pass the function the context in the inContext parameter and a pointer to the VBL task callback function in the inProcPtr parameter. The callback pointer must be of this type:

typedef	Boolean	(*DSpCallbackProcPtr)(DSpContextReference inContext,
 		void *inRefCon);
The reference constant passed in the inrefCon parameter will be handed back by DrawSprocket when it calls the callback procedure. The return value from the inProcPtr parameter is ignored by DrawSprocket. See the MyCallbackFunction function (page 2-75) for a description of the callback.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
2 JUL 1996