Important: The information in this document is obsolete and should not be used for new development.
A function identified as deprecated has been superseded and may become unsupported in the future.
(Deprecated in Mac OS X v10.4. Use Quartz Display Services instead; see Quartz Display Services Reference.)
OSStatus DSpContext_Dispose ( DSpContextReference inContext );
A result code. See “Game Sprockets Result Codes.”
DrawSprocket.h
Sets brightness of the display to the specified intensity. (Deprecated in Mac OS X v10.4. Use Quartz Display Services instead; see Quartz Display Services Reference.)
OSStatus DSpContext_FadeGamma ( DSpContextReference inContext, SInt32 inPercentOfOriginalIntensity, RGBColor *inZeroIntensityColor );
A reference to the context whose display is to be faded. If you pass NULL
for this parameter, the fade operation applies simultaneously to all displays.
The percentage (0–100) of the display’s full intensity that you want to achieve with this call. Values above 100 percent begin to converge on white. If you have specified an intensity color, values less than zero begin to converge on black.
A pointer to the color that is to correspond to zero intensity (represented by a value of 0 in the inPercentOfOriginalIntensity
parameter). If you pass NULL
for this parameter, the zero-intensity color is black.
A result code. See “Game Sprockets Result Codes.”
Fading the display is an aesthetically pleasing way to transition into and out of your game and between different sections of it. When performing a resolution-mode switch (as when activating and deactivating your context’s play state), it is important to fade the display to hide the flash that occurs.
DSpContext_FadeGamma performs a gamma fade, which gives better results than a simple indexed fade.
Fading using DSpContext_FadeGamma
is an incremental process. That is, over a period of time, you make repeated, timed calls to DSpContext_FadeGamma
, each time passing it an incrementally different value for the inPercentOfOriginalIntensity
parameter, until the final desired intensity is achieved. The intensity value you pass is usually an integer between 0 and 100. It can be greater than 100, if you want to use fading to create a high-intensity burst of light, or less than 100 if you have specified a zero-intensity color and want to fade the color toward black.
The zero-intensity value that you fade out to is by default black, but it can be any color that you specify in the inZeroIntensityColor
parameter. You can achieve special effects by fading partially toward one zero-intensity color and then completing the fade to a different one. At the point when you actually switch resolution modes, the zero-intensity color must be black and your display must be completely faded if there is to be no visible flash.
To automatically accomplish a smooth fade all the way from full intensity to zero intensity, or vice versa, in a single operation, use the function DSpContext_FadeGammaIn
and the DSpContext_FadeGammaOut
function.
Do not call at interrupt time.
Introduced with DrawSprocket 1.0.
DrawSprocket.h
Completely fades in a display to a color of your choice. (Deprecated in Mac OS X v10.4. Use Quartz Display Services instead; see Quartz Display Services Reference.)
OSStatus DSpContext_FadeGammaIn ( DSpContextReference inContext, RGBColor *inZeroIntensityColor );
A reference to the context whose display is to be faded. The function fades the display from 0 percent to 100 percent intensity over a period of one second. If you pass NULL
for this parameter, the fade operation applies simultaneously to all displays.
The color that is to correspond to zero intensity. If you pass NULL
for this parameter, the zero-intensity color is black.
A result code. See “Game Sprockets Result Codes.”
A key press or a mouse-button click will jump the fade to its end point immediately.
You can perform a manual fade with the function DSpContext_FadeGamma
.
Do not call at interrupt time.
Introduced with DrawSprocket 1.0.
DrawSprocket.h
Completely fades out a display to a color of your choice. (Deprecated in Mac OS X v10.4. Use Quartz Display Services instead; see Quartz Display Services Reference.)
OSStatus DSpContext_FadeGammaOut ( DSpContextReference inContext, RGBColor *inZeroIntensityColor );
A reference to the context whose display is to be faded. The function fades the display from 100 percent to 0 percent intensity over a period of one second. If you pass NULL
for this parameter, the fade operation applies simultaneously to all displays.
A pointer to the color that is to correspond to zero intensity. If you pass NULL
for this parameter, the zero-intensity color is black.
A result code. See “Game Sprockets Result Codes.”
The initial gamma is that set by DrawSprocket when DSpStartup
was called, or the last gamma value set by calling the DSpContext_FadeGamma
function. If you had changed the system gamma to a different value, you may see a flash at the beginning of the fade due to the change in the initial gamma.
A key press or a mouse button click will jump the fade to its end point immediately.
You can perform a manual fade with the DSpContext_FadeGamma
function.
Do not call at interrupt time.
Introduced with DrawSprocket 1.0.
DrawSprocket.h
Obtains the attributes of a given context. (Deprecated in Mac OS X v10.4. Use Quartz Display Services instead; see Quartz Display Services Reference.)
OSStatus DSpContext_GetAttributes ( DSpContextReferenceConst inContext, DSpContextAttributesPtr outAttributes );
The context whose attributes you want to obtain.
On return, outAttributes
points to a context attributes structure. See DSpContextAttributes
for more information.
A result code. See “Game Sprockets Result Codes.”
Introduced with DrawSprocket 1.0.
DrawSprocket.h
Obtains the back buffer for the context. (Deprecated in Mac OS X v10.4. Use Quartz Display Services instead; see Quartz Display Services Reference.)
OSStatus DSpContext_GetBackBuffer ( DSpContextReference inContext, DSpBufferKind inBufferKind, CGrafPtr *outBackBuffer );
A reference to the context whose back buffer is to be returned.
The kind of buffer. Currently the only supported buffer kind is kDSpBufferKind_Normal
.
On return, a pointer to the back buffer (that is, to a CGrafPort
).
A result code. See “Game Sprockets Result Codes.”
The back buffer, which is where the game should draw to, is the next buffer that will be displayed on a call to the function DSpContext_SwapBuffers
.
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 the DSpContext_IsBusy
function until it returns false
.
Note that 3D hardware accelerators typically must draw using a graphics device ( GDevice
) rather than a graphics port.
Do not call at interrupt time.
Introduced with DrawSprocket 1.0.
DrawSprocket.h
Retrieves one or more color entries from a color lookup table. (Deprecated in Mac OS X v10.4. Use Quartz Display Services instead; see Quartz Display Services Reference.)
OSStatus DSpContext_GetCLUTEntries ( DSpContextReferenceConst inContext, ColorSpec *outEntries, UInt16 inStartingEntry, UInt16 inLastEntry );
The context whose color lookup table is to be accessed.
On return, an array of color specification records that contain the retrieved table entries.
The (zero-based) index position in the color lookup table of the first entry to retrieve.
The number of entries to retrieve.
A result code. See “Game Sprockets Result Codes.”
After you get the entries you can modify them and reassign them to the color table, for purposes such as color-table animation, with the function DSpContext_SetCLUTEntries
.
Do not call at interrupt time.
Introduced with DrawSprocket 1.0.
DrawSprocket.h
Obtains the ID of the display a context is associated with. (Deprecated in Mac OS X v10.4. Use Quartz Display Services instead; see Quartz Display Services Reference.)
OSStatus DSpContext_GetDisplayID ( DSpContextReferenceConst inContext, DisplayIDType *outDisplayID );
A reference to the context whose monitor display ID you want to determine.
On return, the display ID for the monitor associated with the context.
A result code. See “Game Sprockets Result Codes.”
Note that 3D hardware accelerators (such as RAVE) typically must draw using a graphics device ( GDevice
) rather than a graphics port. To do so, you can call DSpContext_GetDisplayID
to get the display ID of the device associated with the context and then call the Display Manager function DMGetDeviceByDisplayID
to obtain the GDevice
.
Do not call at interrupt time.
Introduced with DrawSprocket 1.0.
DrawSprocket.h
Obtains the front buffer for the context. (Deprecated in Mac OS X v10.4. Use Quartz Display Services instead; see Quartz Display Services Reference.)
OSStatus DSpContext_GetFrontBuffer ( DSpContextReferenceConst inContext, CGrafPtr *outFrontBuffer );
A reference to the context whose front buffer is to be returned.
On return, a pointer to the front buffer (that is, to a CGrafPort
).
A result code. See “Game Sprockets Result Codes.”
The front buffer is the screen display. Typically you use this function when you are not using backbuffers and you want to pass a CGrafPtr
so another interface can draw to the screen (for example, by using OpenGL or QuickTime, or you simply want to change resolutions). However, if you are drawing to the screen yourself, you must call DSpContext_GetFrontBuffer
each time through your game’s drawing cycle to compensate for possible page flipping.
Note that 3D hardware accelerators (such as RAVE) typically must draw using a graphics device ( GDevice
) rather than a graphics port. To do so, you should call DSpContext_GetDisplayID
to get the display ID of the device the context is on and then call the Display Manager function DMGetDeviceByDisplayID
to obtain the GDevice
.
Do not call at interrupt time.
Introduced with DrawSprocket 1.1.2.
DrawSprocket.h
Obtains the frequency for the display associated with a context. (Deprecated in Mac OS X v10.4. Use Quartz Display Services instead; see Quartz Display Services Reference.)
OSStatus DSpContext_GetMonitorFrequency ( DSpContextReferenceConst inContext, Fixed *outFrequency );
A reference to a context for which you want to get the display frequency.
On return, the display frequency. The context must have been active for a reasonable amount of time (at least two seconds) in order to receive a correct value, because the value given by this parameter on return is calculated by timing the frame rate of the active context.
A result code. See “Game Sprockets Result Codes.”
Do not call at interrupt time.
Introduced with DrawSprocket 1.0.
DrawSprocket.h
Determines the current play state of a context. (Deprecated in Mac OS X v10.4. Use Quartz Display Services instead; see Quartz Display Services Reference.)
OSStatus DSpContext_GetState ( DSpContextReferenceConst inContext, DSpContextState *outState );
A reference to the context whose play state you want to get.
On return, the play state of the context. Valid return values are kDSpContextState_Active
, kDSpContextState_Paused
, and kDSpContextState_Inactive
. See “Play State Constants” for more information.
A result code. See “Game Sprockets Result Codes.”
Do not call at interrupt time.
Introduced with DrawSprocket 1.0.
DrawSprocket.h
Translates a point in global coordinates into local coordinates for a context. (Deprecated in Mac OS X v10.4. Use Quartz Display Services instead; see Quartz Display Services Reference.)
OSStatus DSpContext_GlobalToLocal ( DSpContextReferenceConst inContext, Point *ioPoint );
A reference to the context whose local coordinates you want to translate into.
Takes a point in global coordinates. On return, contains the point in local coordinates.
A result code. See “Game Sprockets Result Codes.”
Do not call at interrupt time.
Introduced with DrawSprocket 1.0.
DrawSprocket.h
Finds out whether a back buffer is available. (Deprecated in Mac OS X v10.4. Use Quartz Display Services instead; see Quartz Display Services Reference.)
OSStatus DSpContext_IsBusy ( DSpContextReferenceConst inContext, Boolean *outBusyFlag );
A reference to the context associated with the desired back buffer.
On return, contains true
if no back buffer is available, false
if a back buffer is available.
A result code. See “Game Sprockets Result Codes.”
You can use this function to determine whether a call to DSpContext_GetBackBuffer
will block.
Do not call at interrupt time.
Introduced with DrawSprocket 1.0.
DrawSprocket.h
Translates a point from a context’s local coordinates into global coordinates. (Deprecated in Mac OS X v10.4. Use Quartz Display Services instead; see Quartz Display Services Reference.)
OSStatus DSpContext_LocalToGlobal ( DSpContextReferenceConst inContext, Point *ioPoint );
The context whose local coordinate system describes the point’s coordinates.
Takes a point’s local coordinates. On return, contains the point’s global coordinates.
A result code. See “Game Sprockets Result Codes.”
Do not call at interrupt time.
Introduced with DrawSprocket 1.0.
DrawSprocket.h
Queues a context you want to switch to. (Deprecated in Mac OS X v10.4. Use Quartz Display Services instead; see Quartz Display Services Reference.)
OSStatus DSpContext_Queue ( DSpContextReference inParentContext, DSpContextReference inChildContext, DSpContextAttributesPtr inDesiredAttributes );
The current active context.
The context you want to switch to.
A pointer to a context attributes structure that describes the context you want to switch to.
A result code. See “Game Sprockets Result Codes.”
Typically, you use this function to queue up contexts in addition to the one specified by the function DSpContext_Reserve
. After you queue a context, you make it active by calling the function DSpContext_Switch
. To release a queued context, you must call the function DSpContext_Release
.
Calling DSpContext_Queue
also determines whether the desired context switch is actually possible. For example, among other things, DrawSprocket will check to see that both contexts are on the same display. If the contexts are incompatible, this call returns an error.
Note that you can also use this function to modify attributes of the context to be switched to.
Introduced with DrawSprocket 1.7.
DrawSprocket.h
Releases a context you are finished using. (Deprecated in Mac OS X v10.4. Use Quartz Display Services instead; see Quartz Display Services Reference.)
OSStatus DSpContext_Release ( DSpContextReference inContext );
A reference to the context to be released. Releasing the context does not necessarily remove the blanking window from the corresponding display. All displays remain covered by the blanking window until all contexts have been released or put in an inactive play state.
A result code. See “Game Sprockets Result Codes.”
You must release the context whether it was reserved or queued.
Do not call at interrupt time.
Introduced with DrawSprocket 1.0.
DrawSprocket.h
Reserves a context so that you can begin using it in your game. (Deprecated in Mac OS X v10.4. Use Quartz Display Services instead; see Quartz Display Services Reference.)
OSStatus DSpContext_Reserve ( DSpContextReference inContext, DSpContextAttributesPtr inDesiredAttributes );
A reference to the context to reserve. When the context is reserved, it is in the inactive state. There will be no visible indication that the context has been reserved at this point. To enable your context, call DSpContext_SetState
. The context will show up on the display once the context has been placed in the active state.
A pointer to an attributes structure that specifies the configuration you would like for the display when it is in the active or paused state. If you would like to override the attributes of the context, you may do so in the attributes structure. For example, if you ask for a 320x240x16 display but the closest match is a context that is 640x480x32, passing in your requested attributes when you reserve the context will cause the DSpContext_GetBackBuffer
function to return a graphics pointer that refers to a 320x240x16 drawing environment.
A result code. See “Game Sprockets Result Codes.”
You should turn off features that you are not interested in when you reserve the context. For example, if the context supports page flipping (and you know this because you requested the actual capabilities of the context using DSpContext_GetAttributes
), you can turn off the page-flipping bit in your desired attributes so that you will be assured of using software buffering.
You should only specify a back buffer bit depth different from the display bit depth when you absolutely must, as it is the worst case scenario for DrawSprocket and will result in a synchronous call to CopyBits
to bring your back buffer to the display.
To release a reserved context, you must call the function DSpContext_Release
.
Do not call at interrupt time.
Introduced with DrawSprocket 1.0.
DrawSprocket.h
Assigns one or more color entries to a color lookup table. (Deprecated in Mac OS X v10.4. Use Quartz Display Services instead; see Quartz Display Services Reference.)
OSStatus DSpContext_SetCLUTEntries ( DSpContextReference inContext, const ColorSpec *inEntries, UInt16 inStartingEntry, UInt16 inLastEntry );
The context whose color lookup table is to be modified.
A pointer to an array of color specification records.
The (zero-based) index position in the color lookup table of the first entry to replace.
The number of entries to replace.
A result code. See “Game Sprockets Result Codes.”
The DSpContext_SetCLUTEntries
function allows you to change a range of entries in a color lookup table, for purposes such as color-table animation.
Because of video hardware limitations, the changes you make to a color table with this function may not take effect until the next vertical retrace. Nevertheless, this function attempts to execute asynchronously and return immediately, so your program can continue execution without having to wait for the changes to be made.
Do not call at interrupt time.
Introduced with DrawSprocket 1.0.
DrawSprocket.h
Sets the play state of a context. (Deprecated in Mac OS X v10.4. Use Quartz Display Services instead; see Quartz Display Services Reference.)
OSStatus DSpContext_SetState ( DSpContextReference inContext, DSpContextState inState );
A reference to the context whose play state you want to set.
A constant specifying the desired play state. Valid input values for this parameter are kDSpContextState_Active
, kDSpContextState_Paused
, and kDSpContextState_Inactive
. See “Play State Constants” for more information.
A result code. See “Game Sprockets Result Codes.”
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 call DSpProcessEvent
to allow DrawSprocket to correctly handle events such as suspend or resume (see DSpProcessEvent
. 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.
Do not call at interrupt time.
Introduced with DrawSprocket 1.0.
DrawSprocket.h
Draws a context’s back buffer to the screen. (Deprecated in Mac OS X v10.4. Use Quartz Display Services instead; see Quartz Display Services Reference.)
OSStatus DSpContext_SwapBuffers ( DSpContextReference inContext, DSpCallbackUPP inBusyProc, void *inUserRefCon );
A reference to the context whose buffers are to be swapped. The function causes the invalid parts of the back buffer of the context specified in this parameter (or the entire back buffer, if its invalid-rectangle list is empty) to be drawn to the screen.
A pointer to a callback function that performs any required pre-swap tasks. See DSpCallbackProcPtr
for more information about implementing this function.
A reference constant to be handed back by DrawSprocket when it calls the callback specified by the inBusyProc
parameter.
A result code. See “Game Sprockets Result Codes.”
This function returns immediately, even if the buffer swap has not yet occurred. To determine when the next call to DSpContext_GetBackBuffer
will not block, you can repeatedly call the function DSpContext_IsBusy
until it returns a value of false
.
Before performing the buffer swap, DrawSprocket repeatedly calls an application-supplied callback function, pointed to by the inBusyProc
parameter, to make sure that any constraints you impose are satisfied before the swap occurs. When DrawSprocket calls the callback routine, it passes the reference constant you passed to DspContext_SwapBuffers
in the refCon
parameter.
See the callback function under DSpCallbackProcPtr
for more information.
In a worst case scenario where the back buffer and the display have different bit depths, DSpContext_SwapBuffers
immediately calls CopyBits
to transfer the data. To avoid this, and to use the optimized DrawSprocket blitters, always insure that your back buffer and display bit depths are identical.
Do not call at interrupt time.
Introduced with DrawSprocket 1.0.
DrawSprocket.h
Switches display contexts. (Deprecated in Mac OS X v10.4. Use Quartz Display Services instead; see Quartz Display Services Reference.)
OSStatus DSpContext_Switch ( DSpContextReference inOldContext, DSpContextReference inNewContext );
The current display context.
The display context to switch to.
A result code. See “Game Sprockets Result Codes.”
Calling this function switches the display context immediately without any intermediate switch to the default display mode. Note that switching contexts will kill any piggyback VBL routines attached to the context you are switching out.
If you did not queue the contexts you want to switch (by calling the function DSpContext_Queue
), DSpContext_Switch
returns an error.
Introduced with DrawSprocket 1.7.
DrawSprocket.h
Finds the context that best matches the requirements you specify. (Deprecated in Mac OS X v10.4. Use Quartz Display Services instead; see Quartz Display Services Reference.)
OSStatus DSpFindBestContext ( DSpContextAttributesPtr inDesiredAttributes, DSpContextReference *outContext );
A pointer to a context attributes structure describing the desired display characteristics of the context, such as display height and width, preferred pixel depth, and color capability. See DSpContextAttributes
for more information about this structure.
On return, a reference to the context that best meets or exceeds the specified attribute requirements, or NULL
if no such context exists.
A result code. See “Game Sprockets Result Codes.” If no context meets the requirements you specified, the function returns kDSpContextNotFoundErr
.
Even if the call to DSpFindBestContext
returns successtully, the game should check the attributes of the chosen context by calling the function DSpContext_GetAttributes
. It is possible that the game may want to use attributes of the context that exceed those asked for. For example, the game may request a mode such as 320x200x8 but the best match is a 640x480x8 display; the game can adapt to a full screen mode once it is aware of the situation.
Do not call at interrupt time.
Introduced with DrawSprocket 1.0.
DrawSprocket.h
Determines the best context to use for a given display. (Deprecated in Mac OS X v10.4. Use Quartz Display Services instead; see Quartz Display Services Reference.)
OSStatus DSpFindBestContextOnDisplayID ( DSpContextAttributesPtr inDesiredAttributes, DSpContextReference *outContext, DisplayIDType inDisplayID );
A pointer to a structure describing the desired attributes for the context. See DSpContextAttributes
for more information.
On return, outContext
points to the context that best matches the desired attributes, or NULL
if no such context exists.
The ID of the display to check for contexts.
A result code. See “Game Sprockets Result Codes.”
You can obtain the display ID of a monitor by calling the Display Manager.
Introduced with DrawSprocket 1.7.
DrawSprocket.h
Finds out which context contains a point given in global coordinates. (Deprecated in Mac OS X v10.4. Use Quartz Display Services instead; see Quartz Display Services Reference.)
OSStatus DSpFindContextFromPoint ( Point inGlobalPoint, DSpContextReference *outContext );
A point in global coordinates.
On return, a reference to the context that contains that point.
A result code. See “Game Sprockets Result Codes.”
If the user moves the mouse, the game needs to know which context contains it so that the global coordinates can be properly translated into local coordinates for the context.
Do not call at interrupt time.
Introduced with DrawSprocket 1.0.
DrawSprocket.h
Obtains a reference to the current display context for a given display. (Deprecated in Mac OS X v10.4. Use Quartz Display Services instead; see Quartz Display Services Reference.)
OSStatus DSpGetCurrentContext ( DisplayIDType inDisplayID, DSpContextReference *outContext );
The ID of the display whose context you want to obtain.
On return, outContext
points to the current context in the given display.
A result code. See “Game Sprockets Result Codes.”
Introduced with DrawSprocket 1.7.
DrawSprocket.h
Obtains the first context in the list of contexts available for a specified display. (Deprecated in Mac OS X v10.4. Use Quartz Display Services instead; see Quartz Display Services Reference.)
OSStatus DSpGetFirstContext ( DisplayIDType inDisplayID, DSpContextReference *outContext );
The ID of the display whose context you desire. You can obtain the display ID by calling the Display Manager.
On return, a reference to the first context in the list of available contexts for the specified display. You cannot use this context with any function other than DSpContext_GetAttributes
, DSpContext_GetFlattendSize
, DSpContext_Flatten
, and DSpContext_GetDisplayID
unless you reserve it with DSpContext_Reserve
.
A result code. See “Game Sprockets Result Codes.”
Using the function DSpGetFirstContext in combination with DSpGetNextContext
allows you to iterate over the list of contexts and choose one that best suits your needs. You may also have DrawSprocket find one for you with DSpFindBestContext
or let the user select one by calling DSpUserSelectContext
.
Do not call at interrupt time.
Introduced with DrawSprocket 1.0.
DrawSprocket.h
Obtains the global coordinates of the mouse position. (Deprecated in Mac OS X v10.4. Use Quartz Display Services instead; see Quartz Display Services Reference.)
OSStatus DSpGetMouse ( Point *outGlobalPoint );
On return, the global coordinates of the mouse position.
A result code. See “Game Sprockets Result Codes.”
Do not call at interrupt time.
Introduced with DrawSprocket 1.0.
DrawSprocket.h
Obtains the next context in a list of available contexts for a display. (Deprecated in Mac OS X v10.4. Use Quartz Display Services instead; see Quartz Display Services Reference.)
OSStatus DSpGetNextContext ( DSpContextReference inCurrentContext, DSpContextReference *outContext );
A reference to a context in the list of contexts available for a display. This should be a reference that was just returned by DSpGetFirstContext
or DSpGetNextContext
. If this parameter contains the last context in the list, DSpGetNextContext
returns an error.
On return, a reference to the next context in the list of available contexts.
A result code. See “Game Sprockets Result Codes.”
Using the function DSpGetNextContext
in combination with DSpGetFirstContext
allows you to iterate over the list of contexts and choose one that best suits your needs. For example, you could have code such as the following:
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 */ |
} |
You may also have DrawSprocket find a display context for you by calling DSpFindBestContext
or DSpFindBestContextOnDisplayID
.
Do not call at interrupt time.
Introduced with DrawSprocket 1.0.
DrawSprocket.h
Determines the version of DrawSprocket installed on the host computer. (Deprecated in Mac OS X v10.4. Use Quartz Display Services instead; see Quartz Display Services Reference.)
NumVersion DSpGetVersion ( void );
The version number of DrawSprocket installed.
Introduced with DrawSprocket 1.7.
DrawSprocket.h
Passes system events through to DrawSprocket so that it can correctly handle events it must know about. (Deprecated in Mac OS X v10.4. Use Quartz Display Services instead; see Quartz Display Services Reference.)
OSStatus DSpProcessEvent ( EventRecord *inEvent, Boolean *outEventWasProcessed );
A pointer to the event to be passed to DrawSprocket.
On return, true
if DrawSprocket processed the event; false
if the event was not processed.
A result code. See “Game Sprockets Result Codes.”
Whenever your game receives a suspend or resume event, it must call the DSpProcessEvent
function so that DrawSprocket can correctly set the system state for the process switch.
When DrawSprocket is suspended, it returns the display to the resolution mode it was in before your context’s play state first became active. When DrawSprocket resumes, it restores the display to the resolution mode used by your context. However, it is your responsibility to update the contents of the display at this time.
Do not call at interrupt time.
Introduced with DrawSprocket 1.0.
DrawSprocket.h
Assigns a background color to the blanking window for all displays. (Deprecated in Mac OS X v10.4. Use Quartz Display Services instead; see Quartz Display Services Reference.)
OSStatus DSpSetBlankingColor ( const RGBColor *inRGBColor );
A pointer to the background color to use for the blanking window.
A result code. See “Game Sprockets Result Codes.”
The blanking color replaces the desktop and system adornments, such as the menu bar, for all display devices as long as any context is active.
Do not call at interrupt time.
Introduced with DrawSprocket 1.0.
DrawSprocket.h
Keeps the screen and system resources visible during debugging. (Deprecated in Mac OS X v10.4. Use Quartz Display Services instead; see Quartz Display Services Reference.)
OSStatus DSpSetDebugMode ( Boolean inDebugMode );
Set this value to true
if the desktop display is to remain visible, even after fading; false
otherwise.
A result code. See “Game Sprockets Result Codes.”
During development, if you drop into the debugger when the display has been faded out, you cannot fade the display back in so that you can see the debugger screen. Calling the DSpSetDebugMode
function with the inDebugMode
flag set to a value of true
causes your program to enter a mode in which the blanking window is not drawn and every fade operation (either in or out) causes only a partial dimming and immediate restoration of the screen intensity. Calling this function with the inDebugMode
flag set to a value of false
ends the mode and resumes normal operation.
To make use of this function, you must call it before activating your context. Once the blanking window is in place, this function effects only gamma fades.
This function is ignored in nondebugging builds of DrawSprocket.
Note the when using debugging builds, you can also enter debug mode by placing a folder named DSpDebugMode
in your application folder.
Introduced with DrawSprocket 1.0.
DrawSprocket.h
Shuts down DrawSprocket. (Deprecated in Mac OS X v10.4. Use Quartz Display Services instead; see Quartz Display Services Reference.)
OSStatus DSpShutdown ( void );
A result code. See “Game Sprockets Result Codes.”
You must call this function before quitting the application.
Do not call at interrupt time.
Introduced with DrawSprocket 1.0.
DrawSprocket.h
Initializes DrawSprocket. (Deprecated in Mac OS X v10.4. Use Quartz Display Services instead; see Quartz Display Services Reference.)
OSStatus DSpStartup ( void );
A result code. See “Game Sprockets Result Codes.”
You must call this function before attempting to call any DrawSprocket functions (except for DSpGetVersion
).
Note that the debug version of DrawSprocket will notify you if you did not call the DSpStartup
function.
Do not call at interrupt time.
Introduced with DrawSprocket 1.0.
DrawSprocket.h
© 2006 Apple Computer, Inc. All Rights Reserved. (Last updated: 2006-07-13)