limit set cairo

This commit is contained in:
Florian Stecker
2018-08-08 16:24:03 +02:00
commit a373a8ccf7
9 changed files with 1040 additions and 0 deletions

39
initcairo.h Normal file
View File

@@ -0,0 +1,39 @@
#ifndef INITCAIRO_H
#define INITCAIRO_H
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdbool.h>
#include <unistd.h>
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <cairo.h>
#include <cairo-xlib.h>
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