-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathpath.h
43 lines (34 loc) · 921 Bytes
/
path.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#ifndef PATH_H
#define PATH_H
#include <GL/glfw.h>
#include "uthash/utlist.h"
#include "uthash/utarray.h"
#include "mytypes.h"
#include "matrix.h"
#include "gradient.h"
typedef struct Loop {
Vec2 *points;
int npoints;
} Loop;
typedef struct Path {
char *id; // XML path ID
Loop **loops; // (concave) polygons - array of arrays of points
int nloops;
GLubyte fill[4]; // Fill color (for all loops in path)
GLubyte stroke[4]; // Stroke color
int opacity;
Gradient *gradient;
Matrix *transform;
// Next path in lined list
struct Path *next;
} Path;
Path* path_new();
void path_reset(Path *p);
void path_push(Path *p, Vec2 vec);
void path_finish(Path *p);
void path_close(Path *p);
void path_apply_transform(Path *p);
void path_translate(Path *p, Vec2 center);
void path_render(Path *p);
void path_dump(Path *p);
#endif