(Created page with '{{occlass|library=GraphicsServices.framework}} GSHeartbeat is a group of C functions that allows you to register a callback function when the display is updated. It has the …') |
(No difference)
|
Revision as of 15:56, 3 October 2009
GSHeartbeat is a group of C functions that allows you to register a callback function when the display is updated. It has the same purpose as CADisplayLink, but they have nothing in common otherwise.
GSHeartbeat is mainly used for updating the scroller.
Example code
static int counter;
static void heartbeatCallback(void* pCounter, GSHeartbeatTime time) {
printf("%ld: counter = %d\n", time, *(int*)pCounter);
++ *(int*)pCounter;
}
...
GSHeartbeatRef heartbeat = GSHeartbeatCreate(heartbeatCallback, kCFRunLoopDefaultMode, NO, &counter);
...