shithub: dormer

ref: 1f1a8bbd7ce97df5e6798b907de931105387a67a
dir: /dormer.h/

View raw version
typedef struct Dormer Dormer;
typedef struct Visage Visage;
typedef struct Canvas Canvas;
typedef struct Sprite Sprite;
typedef struct Text Text;

struct Dormer
{
	void *dis;
	void *win;
	char *title;
	int ev;
	int key;
	int btn;
	int x, y;
	int width;
	int height;
	int screen;
	int cursor;
} dm;

struct Visage
{
	void *ctx;
	Canvas *canvas;
} vs;

struct Sprite
{
	void *image;
	int x, y;
};

struct Text
{
	void *image;
	void *ft;
	char *str;
	int x, y;
};

struct Canvas
{
	void *bg;
	Sprite *spritev;
	Text *textv;
	int si, ti;
};

extern void winit(void);
extern void readev(void);

extern void present(void);
extern Canvas *canvas(int sn, int tn, long fgcol);
extern Sprite *mksprite(Canvas *c, char *path);
extern void mvsprite(Sprite *s, int x, int y);
extern Text *mktext(Canvas *c, char *str, char *ft, int x, int y, long bgcol);