Starting and ending a drawing frame.


Functions

void XY_start_frame (int fps)
 Mark the start of a frame.
int XY_end_frame (XY_bool throttle)
 Mark the end of a frame.

Function Documentation

void XY_start_frame ( int  fps  ) 

Mark the start of a frame.

Screen backbuffer is wiped to the background color and/or bitmap. Also setting of preferred FPS.

Parameters:
fps The requested FPS, if XY_end_frame()'s throttle option is used.

int XY_end_frame ( XY_bool  throttle  ) 

Mark the end of a frame.

Screen backbuffer is made visible. Optionally, pause until (1000/fps) milliseconds have passed since XY_start_frame() was called. (If 'throttle' is set to XY_TRUE.)

Parameters:
throttle causes XY_end_frame() to pause the application (by calling SDL_Delay()) so that the amount of time between the last XY_start_frame() call and now is approximately 1000/fps milliseconds, if set to XY_TRUE. Otherwise, pauses only 1ms, to relinquish control to the OS.
Returns:
The number of milliseconds since the last XY_start_frame() call. (This will be approximately '1000/fps', if throttle is XY_TRUE and the system was able to do everything in between quickly enough.)
Todo:
Get dirty rectangle merging to work.
Todo:
Subdivide dirty rectangles (to waste less around diagonal lines)


Generated on Sat Aug 16 22:15:09 2008 for libcrtxy by  doxygen 1.5.5