… | |
… | |
6 | typedef struct { |
6 | typedef struct { |
7 | GLuint name; |
7 | GLuint name; |
8 | int x, y, w, h; |
8 | int x, y, w, h; |
9 | } tc_area; |
9 | } tc_area; |
10 | |
10 | |
|
|
11 | extern int tc_generation; |
|
|
12 | |
11 | void tc_get (tc_area *area, int width, int height); |
13 | void tc_get (tc_area *area, int width, int height); |
12 | void tc_put (tc_area *area); |
14 | void tc_put (tc_area *area); |
13 | void tc_clear (); |
15 | void tc_clear (); |
14 | |
16 | |
15 | ///////////////////////////////////////////////////////////////////////////// |
17 | ///////////////////////////////////////////////////////////////////////////// |
16 | |
18 | |
17 | #include <glib.h> |
19 | #include <glib.h> |
|
|
20 | |
|
|
21 | int tc_generation; |
18 | |
22 | |
19 | typedef struct tc_texture { |
23 | typedef struct tc_texture { |
20 | struct tc_texture *next; |
24 | struct tc_texture *next; |
21 | GLuint name; |
25 | GLuint name; |
22 | int avail; |
26 | int avail; |
… | |
… | |
43 | tc_texture *next = first_texture->next; |
47 | tc_texture *next = first_texture->next; |
44 | glDeleteTextures (1, &first_texture->name); |
48 | glDeleteTextures (1, &first_texture->name); |
45 | g_slice_free (tc_texture, first_texture); |
49 | g_slice_free (tc_texture, first_texture); |
46 | first_texture = next; |
50 | first_texture = next; |
47 | } |
51 | } |
|
|
52 | |
|
|
53 | ++tc_generation; |
48 | } |
54 | } |
49 | |
55 | |
50 | void |
56 | void |
51 | tc_get (tc_area *area, int width, int height) |
57 | tc_get (tc_area *area, int width, int height) |
52 | { |
58 | { |