for i=0 to n-1 do { drawframe(i); }
global i = 0; function drawframeCB() { if (i < n) drawframe(i); i = i + 1; }
int i = 0; registerCB(drawframeCB, &i) function drawframeCB(int *pi) { i = *pi; if (i < n) drawframe(i); *pi = i + 1; }
registerCB(drawframeCB) function drawframeCB(float t) { i = int(t / 30) drawframe(i); }