Stops for five seconds on every face. It also changes the number of
frames per second to 4. It seems the CPU can't do all the work for
30FPS, and that's why the keyboard never seemed to work. The queue got
filled up with "drawing" events very fast.
#define HBORDER 32
#define VBORDER 8
+#define STOP_INTERVAL (5*1000)
+#define FPS (4)
+
#include <stdio.h>
#include <stdlib.h>
#include <cairo.h>
SDL_Rect *points;
int psize;
+int stop = 0;
void
ReadPoints (char *filename)
next = (cur + 1) % psize;
if ((points[next].x == rect.x && points[next].y == rect.y) || cur == -1)
{
+ stop = 1;
cur = next;
next = (cur + 1) % psize;
err = 0;
event.type = SDL_USEREVENT;
event.code = 0;
SDL_PushEvent ((SDL_Event *) &event);
- return 33;
+ if (stop)
+ {
+ stop = 0;
+ return STOP_INTERVAL;
+ }
+ return 1000/FPS;
}
int