#ifndef INITCAIRO_H #define INITCAIRO_H #include #include #include #include #include #include #include #include #include typedef struct { Display *display; Window win; Colormap cmap; Atom wm_protocols; Atom wm_delete_window; cairo_surface_t *sfc; cairo_t *ctx; struct timeval start_time; unsigned long frames; double elapsed, frametime; unsigned int width; unsigned int height; cairo_matrix_t matrix; double scalefactor; } GraphicsInfo; int initCairo(int screen, int mask, int width, int height, const char *name, GraphicsInfo *info); void destroyCairo(GraphicsInfo *info); void startTimer(GraphicsInfo *info); void waitUpdateTimer(GraphicsInfo *info); int checkEvents(GraphicsInfo *info, int (*process)(GraphicsInfo*, XEvent*, void*), void (*draw)(void*), void *data); #endif