DSpContext_GetBackBuffer
The DSpContext_GetBackBuffer function returns the back buffer for the context, which is where the game should image to. The back buffer is the next buffer that will be displayed on a call toDSpContext_SwapBuffers
.
OSStatus DSpContext_GetBackBuffer ( DSpContextReference inContext, DSpBufferKind inBufferKind, CGrafPtr *outBackBuffer);
inContext
- A reference to the context whose back buffer is to be returned.
inBufferKind
- The kind of buffer. Currently the only supported buffer kind is
kDSpBufferKind_Normal
.outBackBuffer
- On exit, a pointer to the back buffer.
- function result
- A result code.
DESCRIPTION
The DSpContext_GetBackBuffer function returns, in theoutBackBuffer
parameter, a graphics pointer designating a graphics port containing the back buffer of the context specified in theinContext
parameter. Your game should draw to that back buffer. You specify the kind of buffer in theinBufferKind
parameter, although currently the only supported buffer kind iskDSpBufferKind_Normal
.The pointer to the back buffer may change after a call to
DSpContext_SwapBuffers
, so you must call this function before rendering every frame.If you have specified an underlay for the context, the back buffer will have the underlay image restored before this call returns.
If there are no available back buffers (they are all queued up for display), this function will block until one is available. To avoid blocking, call
DSpContext_IsBusy
(page 2-52) until it returnsfalse
.CALLING RESTRICTIONS
Do not call this function during an interrupt.