Previous Book Contents Book Index Next

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


DSpContext_SetMaxFrameRate

Use the DSpContext_SetMaxFrameRate function to set a maximum frame rate for your game. This call does not guarantee that your game will achieve the maximum rate, but if it attempts to exceed the rate, DrawSprocket will slow down the buffer swapping.

OSStatus DSpContext_SetMaxFrameRate (
DSpContextReference inContext,
UInt32 inMaxFPS);
inContext
A reference to the context whose maximum frame rate you want to set.
inMaxFPS
The maximum frame rate in frames per second.
function result
A result code.
DESCRIPTION
The DSpContext_SetMaxFrameRate function takes, in the inContext parameter, a reference to a context and sets its maximum frame rate to the value you pass in the inMaxFPS parameter. The actual frame rate that is set is not necessarily the frame rate you specified, because DrawSprocket internally converts the specified maximum frame rate into a value that can be used to skip a number of frames for each frame that is drawn.

For example, if the monitor refresh rate is 66.7 Hz, and you request a frame rate of 30 fps DrawSprocket internally skips every other frame, and your resulting frame rate is about 33.3 Hz.

CALLING RESTRICTIONS
Do not call this function during an interrupt.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
2 JUL 1996