Previous Book Contents Book Index Next

Inside Macintosh: Apple Game Sprockets Guide /
Chapter 2 - DrawSprocket / DrawSprocket Reference
DrawSprocket Functions / Drawing and Double Buffering


DSpContext_InvalBackBufferRect

You can use the DSpContext_InvalBackBufferRect function to invalidate a specific area of a context's back buffer, so that only a portion of the screen needs to be redrawn when the buffers are next swapped.

OSStatus DSpContext_InvalBackBufferRect (
DSpContextReference inContext,
const Rect *inRect);
inContext
A reference to the context whose back buffer is to be invalidated.
inRect
A pointer to a rectangle specifying the area (in back-buffer coordinates) to invalidate.
function result
A result code.
DESCRIPTION
The DSpContext_InvalBackBufferRect function invalidates the area of the back buffer specified in the inRect parameter for the context specified in the inContext parameter. If you do not call this function between buffer swaps, the entire back buffer is considered invalid when a swap occurs. The invalid rectangles must be set prior to each call to DSpContext_SwapBuffers; the dirty rectangle list is emptied before DSpContext_GetBackBuffer returns the back buffer for re-use.

You can make multiple calls to this function between swaps to accumulate invalid rectangular areas. For information on the importance of using dirty rectangles, see "Improving Performance With Dirty Rectangles" (page 2-20).

CALLING RESTRICTIONS
Do not call this function during an interrupt.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
2 JUL 1996