-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathwobbly.h
51 lines (45 loc) · 1.08 KB
/
wobbly.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
44
45
46
47
48
49
50
51
/**************************************************************************
*
* Copyright 2014 Scott Moreau <[email protected]>
* All Rights Reserved.
*
**************************************************************************/
#include <stdio.h>
#include <GLES2/gl2.h>
#define WOBBLY_FRICTION 3
#define WOBBLY_SPRING_K 8
struct surface {
void *ww;
int x, y, width, height;
int x_cells, y_cells;
int grabbed, synced;
int vertex_count;
GLfloat *v;
struct {
void *data;
void *uv;
int width;
int height;
} tex;
};
struct window {
int width, height;
};
int
wobbly_init(struct surface *surface);
void
wobbly_fini(struct surface *surface);
void
wobbly_grab_notify(struct surface *surface, int x, int y);
void
wobbly_ungrab_notify(struct surface *surface);
void
wobbly_resize_notify(struct surface *surface);
void
wobbly_move_notify(struct surface *surface, int dx, int dy);
void
wobbly_prepare_paint(struct surface *surface, int msSinceLastPaint);
void
wobbly_done_paint(struct surface *surface);
void
wobbly_add_geometry(struct surface *surface);