-
Notifications
You must be signed in to change notification settings - Fork 1
/
ice.h
361 lines (271 loc) · 5.83 KB
/
ice.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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
#ifndef ICE_H
#define ICE_H
#define ICE_VERSION_MAJOR 1
#define ICE_VERSION_MINOR 4
#define ICE_VERSION_PATCH 1
typedef unsigned char ice_char;
typedef unsigned int ice_uint;
typedef signed int ice_sint;
typedef float ice_real;
void ice_log(
ice_char *message
);
void ice_init();
void ice_deinit();
ice_uint ice_update(
ice_real tick
);
/***********************************[CLOCK]***********************************/
ice_uint ice_clock_init();
void ice_clock_deinit();
ice_real ice_clock_get();
/***********************************[VIDEO]***********************************/
#define ICE_VIDEO_EFFECT_DEFAULT 0
#define ICE_VIDEO_EFFECT_AMBIENT 1
#define ICE_VIDEO_EFFECT_REFLECT 2
#define ICE_VIDEO_EFFECT_LATTICE 3
#define ICE_VIDEO_CLEAR_COLOR 0
#define ICE_VIDEO_CLEAR_DEPTH 1
ice_uint ice_video_init();
void ice_video_deinit();
void ice_video_update();
ice_uint ice_video_width_get();
ice_uint ice_video_height_get();
void ice_video_clear(
ice_uint attribute
);
ice_uint ice_video_texture_load(
ice_uint asset_id
);
void ice_video_texture_delete(
ice_uint texture_id
);
void ice_video_texture_flush();
ice_uint ice_video_texture_asset_id_get(
ice_uint texture_id
);
ice_uint ice_video_texture_width_get(
ice_uint texture_id
);
ice_uint ice_video_texture_height_get(
ice_uint texture_id
);
ice_real ice_video_texture_length_get(
ice_uint texture_id
);
ice_real ice_video_texture_position_get(
ice_uint texture_id
);
void ice_video_texture_position_set(
ice_uint texture_id,
ice_real position
);
void ice_video_texture_rectangle_draw(
ice_uint texture_id,
ice_real d_ax,
ice_real d_ay,
ice_real d_bx,
ice_real d_by,
ice_real s_ax,
ice_real s_ay,
ice_real s_bx,
ice_real s_by,
ice_real c_ar,
ice_real c_ag,
ice_real c_ab,
ice_real c_aa
);
void ice_video_texture_triangle_draw(
ice_uint texture_id,
ice_real d_ax,
ice_real d_ay,
ice_real d_bx,
ice_real d_by,
ice_real d_cx,
ice_real d_cy,
ice_real s_ax,
ice_real s_ay,
ice_real s_bx,
ice_real s_by,
ice_real s_cx,
ice_real s_cy,
ice_real c_ar,
ice_real c_ag,
ice_real c_ab,
ice_real c_aa,
ice_real c_br,
ice_real c_bg,
ice_real c_bb,
ice_real c_ba,
ice_real c_cr,
ice_real c_cg,
ice_real c_cb,
ice_real c_ca
);
ice_uint ice_video_array_new(
ice_uint size
);
void ice_video_array_delete(
ice_uint array_id
);
void ice_video_array_flush();
ice_uint ice_video_array_size_get(
ice_uint array_id
);
void ice_video_array_set(
ice_uint array_id,
ice_uint index,
ice_real value
);
ice_real ice_video_array_get(
ice_uint array_id,
ice_uint index
);
// ice_uint ice_video_model_new();
ice_uint ice_video_model_load(
ice_uint asset_id,
ice_uint mesh_id
);
void ice_video_model_delete(
ice_uint model_id
);
void ice_video_model_flush();
void ice_video_model_draw(
ice_uint model_id,
ice_uint pose_id,
ice_uint projection_id,
ice_uint texture_id,
ice_uint effect,
ice_real c_r,
ice_real c_g,
ice_real c_b,
ice_real c_a
);
/***********************************[AUDIO]***********************************/
#define ICE_AUDIO_STATE_NONE 0
#define ICE_AUDIO_STATE_PAUSED 1
#define ICE_AUDIO_STATE_PLAYING 2
#define ICE_AUDIO_STATE_LOOPING 3
ice_uint ice_audio_init();
void ice_audio_deinit();
void ice_audio_update();
void ice_audio_sample_flush();
void ice_audio_source_flush();
void ice_audio_stream_flush();
ice_uint ice_audio_sample_load(
ice_uint file_id
);
void ice_audio_sample_delete(
ice_uint sample_id
);
ice_real ice_audio_sample_length_get(
ice_uint sample_id
);
ice_uint ice_audio_source_new();
void ice_audio_source_delete(
ice_uint source_id
);
ice_uint ice_audio_source_sample_get(
ice_uint source_id
);
void ice_audio_source_sample_set(
ice_uint source_id,
ice_uint sample_id
);
ice_real ice_audio_source_position_get(
ice_uint source_Id
);
void ice_audio_source_position_set(
ice_uint source_id,
ice_real position
);
ice_uint ice_audio_source_state_get(
ice_uint source_id
);
void ice_audio_source_state_set(
ice_uint source_id,
ice_uint state
);
ice_real ice_audio_source_volume_get(
ice_uint source_id
);
void ice_audio_source_volume_set(
ice_uint source_id,
ice_real volume
);
ice_uint ice_audio_stream_load(
ice_uint file_id
);
void ice_audio_stream_delete(
ice_uint stream_id
);
ice_real ice_audio_stream_length_get(
ice_uint stream_id
);
ice_real ice_audio_stream_position_get(
ice_uint stream_id
);
void ice_audio_stream_position_set(
ice_uint stream_id,
ice_real position
);
ice_uint ice_audio_stream_state_get(
ice_uint stream_id
);
void ice_audio_stream_state_set(
ice_uint stream_id,
ice_uint state
);
ice_real ice_audio_stream_volume_get(
ice_uint stream_id
);
void ice_audio_stream_volume_set(
ice_uint stream_id,
ice_real volume
);
/***********************************[INPUT]***********************************/
#define ICE_INPUT_DEVICE_KEYBOARD 0
#define ICE_INPUT_DEVICE_MOUSE 1
#define ICE_INPUT_DEVICE_GAMEPAD 2
#define ICE_INPUT_SENSOR_KEYBOARD_BUTTON 0
#define ICE_INPUT_SENSOR_MOUSE_OFFSET_X 0
#define ICE_INPUT_SENSOR_MOUSE_OFFSET_Y 1
#define ICE_INPUT_SENSOR_MOUSE_LEFT_BUTTON 2
#define ICE_INPUT_SENSOR_MOUSE_RIGHT_BUTTON 3
#define ICE_INPUT_SENSOR_MOUSE_MIDDLE_BUTTON 4
ice_uint ice_input_init();
void ice_input_deinit();
void ice_input_update();
ice_char ice_input_poll(
ice_uint *device_id,
ice_uint *sensor_id,
ice_real *sensor_state
);
ice_real ice_input_get(
ice_uint device_id,
ice_uint sensor_id
);
/***********************************[CACHE]***********************************/
ice_uint ice_cache_init();
void ice_cache_deinit();
ice_uint ice_cache_slot_open(
ice_uint slot_id
);
void ice_cache_slot_close(
ice_uint slot_id
);
void ice_cache_slot_delete(
ice_uint slot_id
);
void ice_cache_slot_seek(
ice_uint slot_id,
ice_uint address
);
ice_char ice_cache_slot_read(
ice_uint slot_id
);
void ice_cache_slot_write(
ice_uint slot_id,
ice_char byte
);
#endif