gosu 0.15.1 → 0.15.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,126 @@
1
+ #include <Gosu/Color.hpp>
2
+ #include <Gosu/Color.h>
3
+
4
+ #ifdef __cplusplus
5
+ extern "C" {
6
+ #endif
7
+
8
+ unsigned Gosu_Color_create(unsigned argb)
9
+ {
10
+ return Gosu::Color(argb).argb();
11
+ }
12
+ unsigned Gosu_Color_create_argb(Gosu_Color_Channel a, Gosu_Color_Channel r, Gosu_Color_Channel g, Gosu_Color_Channel b)
13
+ {
14
+ return Gosu::Color(a, r, g, b).argb();
15
+ }
16
+ unsigned Gosu_Color_create_from_hsv(double h, double s, double v)
17
+ {
18
+ return Gosu::Color::from_hsv(h, s, v).argb();
19
+ }
20
+ unsigned Gosu_Color_create_from_ahsv(Gosu_Color_Channel alpha, double h, double s, double v)
21
+ {
22
+ return Gosu::Color::from_ahsv(alpha, h, s, v).argb();
23
+ }
24
+
25
+ Gosu_Color_Channel Gosu_Color_alpha(unsigned color)
26
+ {
27
+ return Gosu::Color(color).alpha();
28
+ }
29
+ Gosu_Color_Channel Gosu_Color_red(unsigned color)
30
+ {
31
+ return Gosu::Color(color).red();
32
+ }
33
+ Gosu_Color_Channel Gosu_Color_green(unsigned color)
34
+ {
35
+ return Gosu::Color(color).green();
36
+ }
37
+ Gosu_Color_Channel Gosu_Color_blue(unsigned color)
38
+ {
39
+ return Gosu::Color(color).blue();
40
+ }
41
+
42
+ unsigned Gosu_Color_set_alpha(unsigned color, Gosu_Color_Channel value)
43
+ {
44
+ Gosu::Color gosu_color = Gosu::Color(color);
45
+ gosu_color.set_alpha(value);
46
+
47
+ return gosu_color.argb();
48
+ }
49
+ unsigned Gosu_Color_set_red(unsigned color, Gosu_Color_Channel value)
50
+ {
51
+ Gosu::Color gosu_color = Gosu::Color(color);
52
+ gosu_color.set_red(value);
53
+
54
+ return gosu_color.argb();
55
+ }
56
+ unsigned Gosu_Color_set_green(unsigned color, Gosu_Color_Channel value)
57
+ {
58
+ Gosu::Color gosu_color = Gosu::Color(color);
59
+ gosu_color.set_green(value);
60
+
61
+ return gosu_color.argb();
62
+ }
63
+ unsigned Gosu_Color_set_blue(unsigned color, Gosu_Color_Channel value)
64
+ {
65
+ Gosu::Color gosu_color = Gosu::Color(color);
66
+ gosu_color.set_blue(value);
67
+
68
+ return gosu_color.argb();
69
+ }
70
+
71
+ double Gosu_Color_hue(unsigned color)
72
+ {
73
+ return Gosu::Color(color).hue();
74
+ }
75
+ double Gosu_Color_saturation(unsigned color)
76
+ {
77
+ return Gosu::Color(color).saturation();
78
+ }
79
+ double Gosu_Color_value(unsigned color)
80
+ {
81
+ return Gosu::Color(color).value();
82
+ }
83
+
84
+ unsigned Gosu_Color_set_hue(unsigned color, double value)
85
+ {
86
+ Gosu::Color gosu_color = Gosu::Color(color);
87
+ gosu_color.set_hue(value);
88
+
89
+ return gosu_color.argb();
90
+ }
91
+ unsigned Gosu_Color_set_saturation(unsigned color, double value)
92
+ {
93
+ Gosu::Color gosu_color = Gosu::Color(color);
94
+ gosu_color.set_saturation(value);
95
+
96
+ return gosu_color.argb();
97
+ }
98
+ unsigned Gosu_Color_set_value(unsigned color, double value)
99
+ {
100
+ Gosu::Color gosu_color = Gosu::Color(color);
101
+ gosu_color.set_value(value);
102
+
103
+ return gosu_color.argb();
104
+ }
105
+
106
+ unsigned Gosu_Color_argb(unsigned color)
107
+ {
108
+ return Gosu::Color(color).argb();
109
+ }
110
+ unsigned Gosu_Color_bgr(unsigned color)
111
+ {
112
+ return Gosu::Color(color).bgr();
113
+ }
114
+ unsigned Gosu_Color_abgr(unsigned color)
115
+ {
116
+ return Gosu::Color(color).abgr();
117
+ }
118
+
119
+ unsigned Gosu_Color_gl(unsigned color)
120
+ {
121
+ return color;
122
+ }
123
+
124
+ #ifdef __cplusplus
125
+ }
126
+ #endif
@@ -0,0 +1,287 @@
1
+ #include <Gosu/Version.hpp>
2
+ #include <Gosu/Buttons.hpp>
3
+ #include <Gosu/GraphicsBase.hpp>
4
+
5
+ #ifdef __cplusplus
6
+ extern "C" {
7
+ #endif
8
+
9
+ const char *Gosu_version()
10
+ {
11
+ return Gosu::VERSION.c_str();
12
+ }
13
+
14
+ const char *Gosu_licenses()
15
+ {
16
+ return Gosu::LICENSES.c_str();
17
+ }
18
+
19
+ unsigned Gosu_MAJOR_VERSION = GOSU_MAJOR_VERSION;
20
+ unsigned Gosu_MINOR_VERSION = GOSU_MINOR_VERSION;
21
+ unsigned Gosu_POINT_VERSION = GOSU_POINT_VERSION;
22
+
23
+ // Alpha/Blend Modes
24
+ unsigned Gosu_AM_DEFAULT = Gosu::AM_DEFAULT;
25
+ unsigned Gosu_AM_INTERPOLATE = Gosu::AM_INTERPOLATE;
26
+ unsigned Gosu_AM_ADD = Gosu::AM_ADD;
27
+ unsigned Gosu_AM_MULTIPLY = Gosu::AM_MULTIPLY;
28
+
29
+ // Font Flags
30
+ unsigned Gosu_FF_BOLD = Gosu::FF_BOLD;
31
+ unsigned Gosu_FF_ITALIC = Gosu::FF_ITALIC;
32
+ unsigned Gosu_FF_UNDERLINE = Gosu::FF_UNDERLINE;
33
+ unsigned Gosu_FF_COMBINATIONS = Gosu::FF_COMBINATIONS;
34
+
35
+ // Alignment
36
+ unsigned Gosu_AL_LEFT = Gosu::AL_LEFT;
37
+ unsigned Gosu_AL_RIGHT = Gosu::AL_RIGHT;
38
+ unsigned Gosu_AL_CENTER = Gosu::AL_CENTER;
39
+ unsigned Gosu_AL_JUSTIFY = Gosu::AL_JUSTIFY;
40
+
41
+ // Image Flags
42
+ unsigned Gosu_IF_SMOOTH = Gosu::IF_SMOOTH;
43
+ unsigned Gosu_IF_TILEABLE_LEFT = Gosu::IF_TILEABLE_LEFT;
44
+ unsigned Gosu_IF_TILEABLE_TOP = Gosu::IF_TILEABLE_TOP;
45
+ unsigned Gosu_IF_TILEABLE_RIGHT = Gosu::IF_TILEABLE_RIGHT;
46
+ unsigned Gosu_IF_TILEABLE_BOTTOM = Gosu::IF_TILEABLE_BOTTOM;
47
+ unsigned Gosu_IF_TILEABLE = Gosu::IF_TILEABLE;
48
+ unsigned Gosu_IF_RETRO = Gosu::IF_RETRO;
49
+
50
+ unsigned Gosu_KB_RANGE_BEGIN = Gosu::KB_RANGE_BEGIN;
51
+ unsigned Gosu_KB_ESCAPE = Gosu::KB_ESCAPE;
52
+ unsigned Gosu_KB_F1 = Gosu::KB_F1;
53
+ unsigned Gosu_KB_F2 = Gosu::KB_F2;
54
+ unsigned Gosu_KB_F3 = Gosu::KB_F3;
55
+ unsigned Gosu_KB_F4 = Gosu::KB_F4;
56
+ unsigned Gosu_KB_F5 = Gosu::KB_F5;
57
+ unsigned Gosu_KB_F6 = Gosu::KB_F6;
58
+ unsigned Gosu_KB_F7 = Gosu::KB_F7;
59
+ unsigned Gosu_KB_F8 = Gosu::KB_F8;
60
+ unsigned Gosu_KB_F9 = Gosu::KB_F9;
61
+ unsigned Gosu_KB_F10 = Gosu::KB_F10;
62
+ unsigned Gosu_KB_F11 = Gosu::KB_F11;
63
+ unsigned Gosu_KB_F12 = Gosu::KB_F12;
64
+ unsigned Gosu_KB_0 = Gosu::KB_0;
65
+ unsigned Gosu_KB_1 = Gosu::KB_1;
66
+ unsigned Gosu_KB_2 = Gosu::KB_2;
67
+ unsigned Gosu_KB_3 = Gosu::KB_3;
68
+ unsigned Gosu_KB_4 = Gosu::KB_4;
69
+ unsigned Gosu_KB_5 = Gosu::KB_5;
70
+ unsigned Gosu_KB_6 = Gosu::KB_6;
71
+ unsigned Gosu_KB_7 = Gosu::KB_7;
72
+ unsigned Gosu_KB_8 = Gosu::KB_8;
73
+ unsigned Gosu_KB_9 = Gosu::KB_9;
74
+ unsigned Gosu_KB_TAB = Gosu::KB_TAB;
75
+ unsigned Gosu_KB_RETURN = Gosu::KB_RETURN;
76
+ unsigned Gosu_KB_SPACE = Gosu::KB_SPACE;
77
+ unsigned Gosu_KB_LEFT_SHIFT = Gosu::KB_LEFT_SHIFT;
78
+ unsigned Gosu_KB_RIGHT_SHIFT = Gosu::KB_RIGHT_SHIFT;
79
+ unsigned Gosu_KB_LEFT_CONTROL = Gosu::KB_LEFT_CONTROL;
80
+ unsigned Gosu_KB_RIGHT_CONTROL = Gosu::KB_RIGHT_CONTROL;
81
+ unsigned Gosu_KB_LEFT_ALT = Gosu::KB_LEFT_ALT;
82
+ unsigned Gosu_KB_RIGHT_ALT = Gosu::KB_RIGHT_ALT;
83
+ unsigned Gosu_KB_LEFT_META = Gosu::KB_LEFT_META;
84
+ unsigned Gosu_KB_RIGHT_META = Gosu::KB_RIGHT_META;
85
+ unsigned Gosu_KB_BACKSPACE = Gosu::KB_BACKSPACE;
86
+ unsigned Gosu_KB_LEFT = Gosu::KB_LEFT;
87
+ unsigned Gosu_KB_RIGHT = Gosu::KB_RIGHT;
88
+ unsigned Gosu_KB_UP = Gosu::KB_UP;
89
+ unsigned Gosu_KB_DOWN = Gosu::KB_DOWN;
90
+ unsigned Gosu_KB_HOME = Gosu::KB_HOME;
91
+ unsigned Gosu_KB_END = Gosu::KB_END;
92
+ unsigned Gosu_KB_INSERT = Gosu::KB_INSERT;
93
+ unsigned Gosu_KB_DELETE = Gosu::KB_DELETE;
94
+ unsigned Gosu_KB_PAGE_UP = Gosu::KB_PAGE_UP;
95
+ unsigned Gosu_KB_PAGE_DOWN = Gosu::KB_PAGE_DOWN;
96
+ unsigned Gosu_KB_ENTER = Gosu::KB_ENTER;
97
+ unsigned Gosu_KB_BACKTICK = Gosu::KB_BACKTICK;
98
+ unsigned Gosu_KB_MINUS = Gosu::KB_MINUS;
99
+ unsigned Gosu_KB_EQUALS = Gosu::KB_EQUALS;
100
+ unsigned Gosu_KB_LEFT_BRACKET = Gosu::KB_LEFT_BRACKET;
101
+ unsigned Gosu_KB_RIGHT_BRACKET = Gosu::KB_RIGHT_BRACKET;
102
+ unsigned Gosu_KB_BACKSLASH = Gosu::KB_BACKSLASH;
103
+ unsigned Gosu_KB_SEMICOLON = Gosu::KB_SEMICOLON;
104
+ unsigned Gosu_KB_APOSTROPHE = Gosu::KB_APOSTROPHE;
105
+ unsigned Gosu_KB_COMMA = Gosu::KB_COMMA;
106
+ unsigned Gosu_KB_PERIOD = Gosu::KB_PERIOD;
107
+ unsigned Gosu_KB_SLASH = Gosu::KB_SLASH;
108
+ unsigned Gosu_KB_A = Gosu::KB_A;
109
+ unsigned Gosu_KB_B = Gosu::KB_B;
110
+ unsigned Gosu_KB_C = Gosu::KB_C;
111
+ unsigned Gosu_KB_D = Gosu::KB_D;
112
+ unsigned Gosu_KB_E = Gosu::KB_E;
113
+ unsigned Gosu_KB_F = Gosu::KB_F;
114
+ unsigned Gosu_KB_G = Gosu::KB_G;
115
+ unsigned Gosu_KB_H = Gosu::KB_H;
116
+ unsigned Gosu_KB_I = Gosu::KB_I;
117
+ unsigned Gosu_KB_J = Gosu::KB_J;
118
+ unsigned Gosu_KB_K = Gosu::KB_K;
119
+ unsigned Gosu_KB_L = Gosu::KB_L;
120
+ unsigned Gosu_KB_M = Gosu::KB_M;
121
+ unsigned Gosu_KB_N = Gosu::KB_N;
122
+ unsigned Gosu_KB_O = Gosu::KB_O;
123
+ unsigned Gosu_KB_P = Gosu::KB_P;
124
+ unsigned Gosu_KB_Q = Gosu::KB_Q;
125
+ unsigned Gosu_KB_R = Gosu::KB_R;
126
+ unsigned Gosu_KB_S = Gosu::KB_S;
127
+ unsigned Gosu_KB_T = Gosu::KB_T;
128
+ unsigned Gosu_KB_U = Gosu::KB_U;
129
+ unsigned Gosu_KB_V = Gosu::KB_V;
130
+ unsigned Gosu_KB_W = Gosu::KB_W;
131
+ unsigned Gosu_KB_X = Gosu::KB_X;
132
+ unsigned Gosu_KB_Y = Gosu::KB_Y;
133
+ unsigned Gosu_KB_Z = Gosu::KB_Z;
134
+ unsigned Gosu_KB_ISO = Gosu::KB_ISO;
135
+ unsigned Gosu_KB_NUMPAD_0 = Gosu::KB_NUMPAD_0;
136
+ unsigned Gosu_KB_NUMPAD_1 = Gosu::KB_NUMPAD_1;
137
+ unsigned Gosu_KB_NUMPAD_2 = Gosu::KB_NUMPAD_2;
138
+ unsigned Gosu_KB_NUMPAD_3 = Gosu::KB_NUMPAD_3;
139
+ unsigned Gosu_KB_NUMPAD_4 = Gosu::KB_NUMPAD_4;
140
+ unsigned Gosu_KB_NUMPAD_5 = Gosu::KB_NUMPAD_5;
141
+ unsigned Gosu_KB_NUMPAD_6 = Gosu::KB_NUMPAD_6;
142
+ unsigned Gosu_KB_NUMPAD_7 = Gosu::KB_NUMPAD_7;
143
+ unsigned Gosu_KB_NUMPAD_8 = Gosu::KB_NUMPAD_8;
144
+ unsigned Gosu_KB_NUMPAD_9 = Gosu::KB_NUMPAD_9;
145
+ unsigned Gosu_KB_NUMPAD_DELETE = Gosu::KB_NUMPAD_DELETE;
146
+ unsigned Gosu_KB_NUMPAD_PLUS = Gosu::KB_NUMPAD_PLUS;
147
+ unsigned Gosu_KB_NUMPAD_MINUS = Gosu::KB_NUMPAD_MINUS;
148
+ unsigned Gosu_KB_NUMPAD_MULTIPLY = Gosu::KB_NUMPAD_MULTIPLY;
149
+ unsigned Gosu_KB_NUMPAD_DIVIDE = Gosu::KB_NUMPAD_DIVIDE;
150
+ unsigned Gosu_KB_RANGE_END = Gosu::KB_RANGE_END;
151
+
152
+ unsigned Gosu_MS_RANGE_BEGIN = Gosu::MS_RANGE_BEGIN;
153
+ unsigned Gosu_MS_LEFT = Gosu::MS_LEFT;
154
+ unsigned Gosu_MS_MIDDLE = Gosu::MS_MIDDLE;
155
+ unsigned Gosu_MS_RIGHT = Gosu::MS_RIGHT;
156
+ unsigned Gosu_MS_WHEEL_UP = Gosu::MS_WHEEL_UP;
157
+ unsigned Gosu_MS_WHEEL_DOWN = Gosu::MS_WHEEL_DOWN;
158
+ unsigned Gosu_MS_OTHER_0 = Gosu::MS_OTHER_0;
159
+ unsigned Gosu_MS_OTHER_1 = Gosu::MS_OTHER_1;
160
+ unsigned Gosu_MS_OTHER_2 = Gosu::MS_OTHER_2;
161
+ unsigned Gosu_MS_OTHER_3 = Gosu::MS_OTHER_3;
162
+ unsigned Gosu_MS_OTHER_4 = Gosu::MS_OTHER_4;
163
+ unsigned Gosu_MS_OTHER_5 = Gosu::MS_OTHER_5;
164
+ unsigned Gosu_MS_OTHER_6 = Gosu::MS_OTHER_6;
165
+ unsigned Gosu_MS_OTHER_7 = Gosu::MS_OTHER_7;
166
+ unsigned Gosu_MS_RANGE_END = Gosu::MS_RANGE_END;
167
+
168
+ unsigned Gosu_GP_RANGE_BEGIN = Gosu::GP_RANGE_BEGIN;
169
+ unsigned Gosu_GP_LEFT = Gosu::GP_LEFT;
170
+ unsigned Gosu_GP_RIGHT = Gosu::GP_RIGHT;
171
+ unsigned Gosu_GP_UP = Gosu::GP_UP;
172
+ unsigned Gosu_GP_DOWN = Gosu::GP_DOWN;
173
+ unsigned Gosu_GP_BUTTON_0 = Gosu::GP_BUTTON_0;
174
+ unsigned Gosu_GP_BUTTON_1 = Gosu::GP_BUTTON_1;
175
+ unsigned Gosu_GP_BUTTON_2 = Gosu::GP_BUTTON_2;
176
+ unsigned Gosu_GP_BUTTON_3 = Gosu::GP_BUTTON_3;
177
+ unsigned Gosu_GP_BUTTON_4 = Gosu::GP_BUTTON_4;
178
+ unsigned Gosu_GP_BUTTON_5 = Gosu::GP_BUTTON_5;
179
+ unsigned Gosu_GP_BUTTON_6 = Gosu::GP_BUTTON_6;
180
+ unsigned Gosu_GP_BUTTON_7 = Gosu::GP_BUTTON_7;
181
+ unsigned Gosu_GP_BUTTON_8 = Gosu::GP_BUTTON_8;
182
+ unsigned Gosu_GP_BUTTON_9 = Gosu::GP_BUTTON_9;
183
+ unsigned Gosu_GP_BUTTON_10 = Gosu::GP_BUTTON_10;
184
+ unsigned Gosu_GP_BUTTON_11 = Gosu::GP_BUTTON_11;
185
+ unsigned Gosu_GP_BUTTON_12 = Gosu::GP_BUTTON_12;
186
+ unsigned Gosu_GP_BUTTON_13 = Gosu::GP_BUTTON_13;
187
+ unsigned Gosu_GP_BUTTON_14 = Gosu::GP_BUTTON_14;
188
+ unsigned Gosu_GP_BUTTON_15 = Gosu::GP_BUTTON_15;
189
+
190
+ unsigned Gosu_GP_0_LEFT = Gosu::GP_0_LEFT;
191
+ unsigned Gosu_GP_0_RIGHT = Gosu::GP_0_RIGHT;
192
+ unsigned Gosu_GP_0_UP = Gosu::GP_0_UP;
193
+ unsigned Gosu_GP_0_DOWN = Gosu::GP_0_DOWN;
194
+ unsigned Gosu_GP_0_BUTTON_0 = Gosu::GP_0_BUTTON_0;
195
+ unsigned Gosu_GP_0_BUTTON_1 = Gosu::GP_0_BUTTON_1;
196
+ unsigned Gosu_GP_0_BUTTON_2 = Gosu::GP_0_BUTTON_2;
197
+ unsigned Gosu_GP_0_BUTTON_3 = Gosu::GP_0_BUTTON_3;
198
+ unsigned Gosu_GP_0_BUTTON_4 = Gosu::GP_0_BUTTON_4;
199
+ unsigned Gosu_GP_0_BUTTON_5 = Gosu::GP_0_BUTTON_5;
200
+ unsigned Gosu_GP_0_BUTTON_6 = Gosu::GP_0_BUTTON_6;
201
+ unsigned Gosu_GP_0_BUTTON_7 = Gosu::GP_0_BUTTON_7;
202
+ unsigned Gosu_GP_0_BUTTON_8 = Gosu::GP_0_BUTTON_8;
203
+ unsigned Gosu_GP_0_BUTTON_9 = Gosu::GP_0_BUTTON_9;
204
+ unsigned Gosu_GP_0_BUTTON_10 = Gosu::GP_0_BUTTON_10;
205
+ unsigned Gosu_GP_0_BUTTON_11 = Gosu::GP_0_BUTTON_11;
206
+ unsigned Gosu_GP_0_BUTTON_12 = Gosu::GP_0_BUTTON_12;
207
+ unsigned Gosu_GP_0_BUTTON_13 = Gosu::GP_0_BUTTON_13;
208
+ unsigned Gosu_GP_0_BUTTON_14 = Gosu::GP_0_BUTTON_14;
209
+ unsigned Gosu_GP_0_BUTTON_15 = Gosu::GP_0_BUTTON_15;
210
+
211
+ unsigned Gosu_GP_1_LEFT = Gosu::GP_1_LEFT;
212
+ unsigned Gosu_GP_1_RIGHT = Gosu::GP_1_RIGHT;
213
+ unsigned Gosu_GP_1_UP = Gosu::GP_1_UP;
214
+ unsigned Gosu_GP_1_DOWN = Gosu::GP_1_DOWN;
215
+ unsigned Gosu_GP_1_BUTTON_0 = Gosu::GP_1_BUTTON_0;
216
+ unsigned Gosu_GP_1_BUTTON_1 = Gosu::GP_1_BUTTON_1;
217
+ unsigned Gosu_GP_1_BUTTON_2 = Gosu::GP_1_BUTTON_2;
218
+ unsigned Gosu_GP_1_BUTTON_3 = Gosu::GP_1_BUTTON_3;
219
+ unsigned Gosu_GP_1_BUTTON_4 = Gosu::GP_1_BUTTON_4;
220
+ unsigned Gosu_GP_1_BUTTON_5 = Gosu::GP_1_BUTTON_5;
221
+ unsigned Gosu_GP_1_BUTTON_6 = Gosu::GP_1_BUTTON_6;
222
+ unsigned Gosu_GP_1_BUTTON_7 = Gosu::GP_1_BUTTON_7;
223
+ unsigned Gosu_GP_1_BUTTON_8 = Gosu::GP_1_BUTTON_8;
224
+ unsigned Gosu_GP_1_BUTTON_9 = Gosu::GP_1_BUTTON_9;
225
+ unsigned Gosu_GP_1_BUTTON_10 = Gosu::GP_1_BUTTON_10;
226
+ unsigned Gosu_GP_1_BUTTON_11 = Gosu::GP_1_BUTTON_11;
227
+ unsigned Gosu_GP_1_BUTTON_12 = Gosu::GP_1_BUTTON_12;
228
+ unsigned Gosu_GP_1_BUTTON_13 = Gosu::GP_1_BUTTON_13;
229
+ unsigned Gosu_GP_1_BUTTON_14 = Gosu::GP_1_BUTTON_14;
230
+ unsigned Gosu_GP_1_BUTTON_15 = Gosu::GP_1_BUTTON_15;
231
+
232
+ unsigned Gosu_GP_2_LEFT = Gosu::GP_2_LEFT;
233
+ unsigned Gosu_GP_2_RIGHT = Gosu::GP_2_RIGHT;
234
+ unsigned Gosu_GP_2_UP = Gosu::GP_2_UP;
235
+ unsigned Gosu_GP_2_DOWN = Gosu::GP_2_DOWN;
236
+ unsigned Gosu_GP_2_BUTTON_0 = Gosu::GP_2_BUTTON_0;
237
+ unsigned Gosu_GP_2_BUTTON_1 = Gosu::GP_2_BUTTON_1;
238
+ unsigned Gosu_GP_2_BUTTON_2 = Gosu::GP_2_BUTTON_2;
239
+ unsigned Gosu_GP_2_BUTTON_3 = Gosu::GP_2_BUTTON_3;
240
+ unsigned Gosu_GP_2_BUTTON_4 = Gosu::GP_2_BUTTON_4;
241
+ unsigned Gosu_GP_2_BUTTON_5 = Gosu::GP_2_BUTTON_5;
242
+ unsigned Gosu_GP_2_BUTTON_6 = Gosu::GP_2_BUTTON_6;
243
+ unsigned Gosu_GP_2_BUTTON_7 = Gosu::GP_2_BUTTON_7;
244
+ unsigned Gosu_GP_2_BUTTON_8 = Gosu::GP_2_BUTTON_8;
245
+ unsigned Gosu_GP_2_BUTTON_9 = Gosu::GP_2_BUTTON_9;
246
+ unsigned Gosu_GP_2_BUTTON_10 = Gosu::GP_2_BUTTON_10;
247
+ unsigned Gosu_GP_2_BUTTON_11 = Gosu::GP_2_BUTTON_11;
248
+ unsigned Gosu_GP_2_BUTTON_12 = Gosu::GP_2_BUTTON_12;
249
+ unsigned Gosu_GP_2_BUTTON_13 = Gosu::GP_2_BUTTON_13;
250
+ unsigned Gosu_GP_2_BUTTON_14 = Gosu::GP_2_BUTTON_14;
251
+ unsigned Gosu_GP_2_BUTTON_15 = Gosu::GP_2_BUTTON_15;
252
+
253
+ unsigned Gosu_GP_3_LEFT = Gosu::GP_3_LEFT;
254
+ unsigned Gosu_GP_3_RIGHT = Gosu::GP_3_RIGHT;
255
+ unsigned Gosu_GP_3_UP = Gosu::GP_3_UP;
256
+ unsigned Gosu_GP_3_DOWN = Gosu::GP_3_DOWN;
257
+ unsigned Gosu_GP_3_BUTTON_0 = Gosu::GP_3_BUTTON_0;
258
+ unsigned Gosu_GP_3_BUTTON_1 = Gosu::GP_3_BUTTON_1;
259
+ unsigned Gosu_GP_3_BUTTON_2 = Gosu::GP_3_BUTTON_2;
260
+ unsigned Gosu_GP_3_BUTTON_3 = Gosu::GP_3_BUTTON_3;
261
+ unsigned Gosu_GP_3_BUTTON_4 = Gosu::GP_3_BUTTON_4;
262
+ unsigned Gosu_GP_3_BUTTON_5 = Gosu::GP_3_BUTTON_5;
263
+ unsigned Gosu_GP_3_BUTTON_6 = Gosu::GP_3_BUTTON_6;
264
+ unsigned Gosu_GP_3_BUTTON_7 = Gosu::GP_3_BUTTON_7;
265
+ unsigned Gosu_GP_3_BUTTON_8 = Gosu::GP_3_BUTTON_8;
266
+ unsigned Gosu_GP_3_BUTTON_9 = Gosu::GP_3_BUTTON_9;
267
+ unsigned Gosu_GP_3_BUTTON_10 = Gosu::GP_3_BUTTON_10;
268
+ unsigned Gosu_GP_3_BUTTON_11 = Gosu::GP_3_BUTTON_11;
269
+ unsigned Gosu_GP_3_BUTTON_12 = Gosu::GP_3_BUTTON_12;
270
+ unsigned Gosu_GP_3_BUTTON_13 = Gosu::GP_3_BUTTON_13;
271
+ unsigned Gosu_GP_3_BUTTON_14 = Gosu::GP_3_BUTTON_14;
272
+ unsigned Gosu_GP_3_BUTTON_15 = Gosu::GP_3_BUTTON_15;
273
+
274
+ unsigned Gosu_GP_RANGE_END = Gosu::GP_RANGE_END;
275
+
276
+ unsigned Gosu_NUM_BUTTONS = Gosu::NUM_BUTTONS;
277
+ unsigned Gosu_NUM_GAMEPADS = Gosu::NUM_GAMEPADS;
278
+ unsigned Gosu_NO_BUTTON = Gosu::NO_BUTTON;
279
+
280
+ unsigned Gosu_KB_NUM = Gosu::KB_NUM;
281
+ unsigned Gosu_MS_NUM = Gosu::MS_NUM;
282
+ unsigned Gosu_GP_NUM = Gosu::GP_NUM;
283
+ unsigned Gosu_GP_NUM_PER_GAMEPAD = Gosu::GP_NUM_PER_GAMEPAD;
284
+
285
+ #ifdef __cplusplus
286
+ }
287
+ #endif
@@ -10,6 +10,7 @@
10
10
  #include <array>
11
11
  #include <cassert>
12
12
  #include <map>
13
+ #include <stdexcept>
13
14
  using namespace std;
14
15
 
15
16
  static const int FONT_RENDER_SCALE = 2;
@@ -0,0 +1,74 @@
1
+ #include <Gosu/Gosu.hpp>
2
+
3
+ extern "C" {
4
+ #include <Gosu/Image.h>
5
+ #include <Gosu/Font.h>
6
+
7
+ Gosu_Font *Gosu_Font_create(int height, const char *name, unsigned flags)
8
+ {
9
+ return reinterpret_cast<Gosu_Font *>(new Gosu::Font(height, name, flags));
10
+ }
11
+
12
+ const char *Gosu_Font_name(Gosu_Font *font)
13
+ {
14
+ return reinterpret_cast<Gosu::Font *>(font)->name().c_str();
15
+ }
16
+
17
+ int Gosu_Font_height(Gosu_Font *font)
18
+ {
19
+ return reinterpret_cast<Gosu::Font *>(font)->height();
20
+ }
21
+
22
+ unsigned Gosu_Font_flags(Gosu_Font *font)
23
+ {
24
+ return reinterpret_cast<Gosu::Font *>(font)->flags();
25
+ }
26
+
27
+ double Gosu_Font_text_width(Gosu_Font *font, const char *text)
28
+ {
29
+ return reinterpret_cast<Gosu::Font *>(font)->text_width(text);
30
+ }
31
+
32
+ double Gosu_Font_markup_width(Gosu_Font *font, const char *text)
33
+ {
34
+ return reinterpret_cast<Gosu::Font *>(font)->markup_width(text);
35
+ }
36
+
37
+ void Gosu_Font_draw_text(Gosu_Font *font, const char *text, double x, double y, double z,
38
+ double scale_x, double scale_y, unsigned c, unsigned mode)
39
+ {
40
+ reinterpret_cast<Gosu::Font *>(font)->draw_text(text, x, y, z, scale_x, scale_y, c, (Gosu::AlphaMode)mode);
41
+ }
42
+
43
+ void Gosu_Font_draw_markup(Gosu_Font *font, const char *text, double x, double y, double z,
44
+ double scale_x, double scale_y, unsigned c, unsigned mode)
45
+ {
46
+ reinterpret_cast<Gosu::Font *>(font)->draw_markup(text, x, y, z, scale_x, scale_y, c, (Gosu::AlphaMode)mode);
47
+ }
48
+
49
+ void Gosu_Font_draw_text_rel(Gosu_Font *font, const char *text, double x, double y, double z,
50
+ double rel_x, double rel_y, double scale_x, double scale_y,
51
+ unsigned c, unsigned mode)
52
+ {
53
+ reinterpret_cast<Gosu::Font *>(font)->draw_text_rel(text, x, y, z, rel_x, rel_y, scale_x, scale_y, c, (Gosu::AlphaMode)mode);
54
+ }
55
+
56
+ void Gosu_Font_draw_markup_rel(Gosu_Font *font, const char *text, double x, double y, double z,
57
+ double rel_x, double rel_y, double scale_x, double scale_y,
58
+ unsigned c, unsigned mode)
59
+ {
60
+ reinterpret_cast<Gosu::Font *>(font)->draw_markup_rel(text, x, y, z, rel_x, rel_y, scale_x, scale_y, c, (Gosu::AlphaMode)mode);
61
+ }
62
+
63
+ void Gosu_Font_set_image(Gosu_Font *font, const char *codepoint, unsigned font_flags, Gosu_Image *image)
64
+ {
65
+
66
+ const Gosu::Image *gosu_image = reinterpret_cast<Gosu::Image *>(image);
67
+ reinterpret_cast<Gosu::Font *>(font)->set_image(codepoint, font_flags, *gosu_image);
68
+ }
69
+
70
+ void Gosu_Font_destroy(Gosu_Font *font)
71
+ {
72
+ delete (reinterpret_cast<Gosu::Font *>(font));
73
+ }
74
+ }