-
Notifications
You must be signed in to change notification settings - Fork 1
/
raylib.i
562 lines (517 loc) · 19.5 KB
/
raylib.i
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
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
// SWIG-4.0.2 binding for raylib v4.0
// Notes:
//
// Unsupported functions:
// Callback setter functions only accept existing C functions and cannot take lua functions by now.
// void SetTraceLogCallback(TraceLogCallback callback);
// void SetLoadFileDataCallback(LoadFileDataCallback callback);
// void SetSaveFileDataCallback(SaveFileDataCallback callback);
// void SetLoadFileTextCallback(LoadFileTextCallback callback);
// void SetSaveFileTextCallback(SaveFileTextCallback callback);
//
// Ignored functions:
// `TextXXX` string manipulation functions are ignored and not binded.
// Because nearly all the script languages supported by SWIG have their own functions dealing strings, therefore bindings of these functions from C are not that helpful and fail both in performance and in maintainability.
//
// `va_list` related behaviours:
// Functions like `void TraceLog(int logLevel, const char* text, ...);` are binded using the default behaviour of SWIG, which is, skipping the `...` entirely.
// e.g. In Lua, you call `raylib.TraceLog(raylib.LOG_INFO, string.format("%s%d", "This is formatted in Lua instead.", 123))`.
//
// Lua: All syntactic behaviours are now wrapped in Lua style: featuring multi-val return, auto LuaTable-CArray conversion, etc.
// e.g. `local out, outLen = raylib.EncodeDataBase64(data, dataLen)`; `local materials_luaTable = raylib.LoadMaterials(fileName)`
//------
// Module declaration
//------
%module raylib
#ifdef SWIGLUA
%luacode {
local _moduleName = "raylib"
local _swig = _G[_moduleName]
_G[_moduleName] = nil
}
#endif
// Overcome `__stdcall`, `__cdecl` etc. .
#if defined(_WIN32)
%include <windows.i>
#endif
// Define bool, to overcome `typedef enum { false, true } bool;` in raylib.h being unrecognized by SWIG
#ifndef bool
#define bool bool
#endif
#if defined(__EMSCRIPTEN__)
%{
#include <emscripten/emscripten.h>
%}
//void emscripten_set_main_loop(em_callback_func func, int fps, int simulate_infinite_loop);
%{
lua_State* _SWIGExtra__L_for_emscripten = NULL;
int _SWIGExtra__mainLoopRef = 0;
void _SWIGExtra__call_main_loop_for_emscripten(void){
if(lua_gettop(_SWIGExtra__L_for_emscripten) != 0){
lua_pushstring(_SWIGExtra__L_for_emscripten, "_SWIGExtra__call_main_loop_for_emscripten: Stack not empty!");
lua_error(_SWIGExtra__L_for_emscripten);
}
lua_rawgeti(_SWIGExtra__L_for_emscripten, LUA_REGISTRYINDEX, _SWIGExtra__mainLoopRef);
lua_call(_SWIGExtra__L_for_emscripten, 0, 0);
};
int _SWIGExtra_emscripten_set_main_loop(lua_State* L){
int n = lua_gettop(L);
if(n < 1){
lua_pushstring(L, "_SWIGExtra_emscripten_set_main_loop: param 1 needed!");
lua_error(L);
}
if(n > 3)
lua_pop(L, n-3);
int fps, simulate_infinite_loop;
if(lua_isnil(L, 3) || lua_isnone(L, 3)){
simulate_infinite_loop = 1;
}
else if(!lua_isnumber(L, 3))
{
lua_pushstring(L, "_SWIGExtra_emscripten_set_main_loop: param 3 not number!");
lua_error(L);
}
else{
simulate_infinite_loop = (int)lua_tonumber(L, 3);
lua_pop(L, 1);
}
if(lua_isnil(L, 2) || lua_isnone(L, 2)){
fps = 60;
}
else if(!lua_isnumber(L, 2)){
lua_pushstring(L, "_SWIGExtra_emscripten_set_main_loop: param 2 not number!");
lua_error(L);
}
else{
fps = (int)lua_tonumber(L, 2);
lua_pop(L, 1);
}
_SWIGExtra__L_for_emscripten = L;
_SWIGExtra__mainLoopRef = luaL_ref(L, LUA_REGISTRYINDEX);
emscripten_set_main_loop(_SWIGExtra__call_main_loop_for_emscripten, fps, simulate_infinite_loop);
return 0;
};
%}
%native(emscripten_set_main_loop) int _SWIGExtra_emscripten_set_main_loop(lua_State* L);
#endif
%{
#include "config.h"
#include "raylib.h"
#include "raymath.h"
#include "rlgl.h"
%}
#ifdef SWIGRAYLIB_USE_PHYSAC
%{
#include "extras/physac.h"
%}
#endif
//------
// General tags
//------
%ignore TextCopy;
%ignore TextIsEqual;
%ignore TextLength;
%ignore TextFormat;
%ignore TextSubtext;
%ignore TextReplace;
%ignore TextInsert;
%ignore TextJoin;
%ignore TextSplit;
%ignore TextAppend;
%ignore TextFindIndex;
%ignore TextToUpper;
%ignore TextToLower;
%ignore TextToPascal;
%ignore TextToInteger;
%newobject LoadFileText;
%delobject UnloadFileText;
%newobject TextCodepointsToUTF8;
%newobject LoadMaterials;
%newobject LoadWaveSamples;
%delobject UnloadWaveSamples;
%newobject rlReadTexturePixels;
%newobject rlReadScreenPixels;
%newobject _SWIGExtra_CodepointToUTF8_WithNullTerm;
%newobject _SWIGExtra_MatrixToFloat;
%newobject _SWIGExtra_Vector3ToFloat;
//------
// Array type tags
//------
%include <carrays.i>
%array_functions(int, IntArray)
%array_functions(float, FloatArray)
%array_functions(char, CharArray)
%array_functions(unsigned short, UshortArray)
%array_functions(unsigned int, UintArray)
%array_functions(unsigned char, UcharArray)
%array_functions(char*, CharPArray)
%array_functions(Vector2, Vector2Array)
%array_functions(Vector3, Vector3Array)
%array_functions(Vector4, Vector4Array)
%array_functions(Quaternion, QuaternionArray)
%array_functions(Matrix, MatrixArray)
%array_functions(Color, ColorArray)
%array_functions(Rectangle, RectangleArray)
// %array_functions(Image, ImageArray)
// %array_functions(Texture, TextureArray)
// %array_functions(RenderTexture, RenderTextureArray)
// %array_functions(NPatchInfo, NPatchInfoArray)
%array_functions(GlyphInfo, GlyphInfoArray)
// %array_functions(Font, FontArray)
// %array_functions(Camera, CameraArray)
// %array_functions(Camera2D, Camera2DArray)
%array_functions(Mesh, MeshArray)
// %array_functions(Shader, ShaderArray)
%array_functions(MaterialMap, MaterialMapArray)
%array_functions(Material, MaterialArray)
// %array_functions(Model, ModelArray)
%array_functions(Transform, TransformArray)
%array_functions(Transform*, TransformPArray)
%array_functions(BoneInfo, BoneInfoArray)
%array_functions(ModelAnimation, ModelAnimationArray)
// %array_functions(Ray, RayArray)
// %array_functions(RayCollision, RayCollisionArray)
// %array_functions(BoundingBox, BoundingBoxArray)
#ifdef PHYSAC_IMPLEMENTATION
%array_functions(PhysicsBodyData, PhysicsBodyDataArray)
#endif
//------
// Typemap tags + Import the headers
//------
%include <typemaps.i>
#ifdef SWIGLUA
%typemap(in) SWIGTYPE *INPUT {
if (!SWIG_IsOK(SWIG_ConvertPtr(L, $argnum, (void **)&$1, $1_descriptor, 0))){
SWIG_fail_ptr("$symname", $argnum, $1_descriptor);
}
}
%typemap(in, numinputs=0) SWIGTYPE *OUTPUT {};
%typemap(argout) SWIGTYPE *OUTPUT{
SWIG_NewPointerObj(L, $1, $1_descriptor, 1); SWIG_arg++;
}
%typemap(argout) SWIGTYPE *OUTPUT_UNOWN{
SWIG_NewPointerObj(L, $1, $1_descriptor, 0); SWIG_arg++;
}
%typemap(in) SWIGTYPE *INOUT = SWIGTYPE *INPUT;
%typemap(argout) SWIGTYPE *INOUT = SWIGTYPE *OUTPUT_UNOWN;
#endif
//config.h
%include "config.h"
//raylib.h
%apply unsigned int *OUTPUT {unsigned int *bytesRead};
%apply int *OUTPUT {int *compDataLength, int *dataLength, int *outputLength, int *frames};
%apply int *OUTPUT {int *count, int *colorCount, int *glyphCount_out, int *materialCount, int *animCount};
%apply int *INOUT {int *bytesProcessed};
%apply SWIGTYPE *OUTPUT {Vector2 *collisionPoint};
%apply SWIGTYPE **OUTPUT {Rectangle **recs};
%apply SWIGTYPE *INOUT {Camera *camera};
%apply SWIGTYPE *INOUT {Image *image};
%apply SWIGTYPE *INOUT {Texture2D *texture};
%apply SWIGTYPE *INOUT {Mesh *mesh};
%apply SWIGTYPE *INOUT {Material *material};
%apply SWIGTYPE *INOUT {Model *model};
%apply SWIGTYPE *INOUT {Wave *wave};
%apply (Vector2 *INPUT, int) {(Vector2 *points, int pointCount), (Vector2 *texcoords, int texcoordsCount), (int *fontChars, int glyphCount), (int *codepoints, int length)};
%apply (Vector3 *INPUT, int) {(Vector3 *points, int pointCount)};
%apply (Matrix *INPUT, int) {(Matrix *transforms, int instances)};
%include "raylib.h"
void _SWIGExtra_DrawTexturePoly_ArgRearrange(Texture2D texture, Vector2 center, Vector2 *points, int pointsCount, Vector2 *texcoords, int texcoordsCount, Color tint);
GlyphInfo *_SWIGExtra_LoadFontData_ArgRearrange(const unsigned char *fileData, int dataSize, int fontSize, int *fontChars, int glyphCount, int type, int *glyphCount_out);
Image _SWIGExtra_GenImageFontAtlas_ArgRearrange(const GlyphInfo *chars, int glyphCount, int fontSize, int padding, int packMethod, Rectangle **recs, int *glyphCount_out);
char *_SWIGExtra_CodepointToUTF8_WithNullTerm(int codepoint);
%clear unsigned int *bytesRead, int *compDataLength, int *dataLength, int *outputLength, int *frames;
%clear int *count, int *colorCount, int *glyphCount_out, int *materialCount, int *animCount;
%clear int *bytesProcessed;
%clear Vector2 *collisionPoint;
%clear Rectangle **recs;
%clear Camera *camera, Image *image, Texture2D *texture, Mesh *mesh, Material *material, Model *model, Wave *wave;
%clear (Vector2 *points, int pointsCount), (Vector2 *texcoords, int texcoordsCount), (int *fontChars, int glyphCount), (int *codepoints, int length), (Vector3 *points, int pointsCount), (Matrix *transforms, int instances);
//raymath.h
#ifdef SWIGRAYLIB_EXPOSE_RAYMATH
extern void Vector3OrthoNormalize(Vector3 *INOUT, Vector3 *INOUT);
extern void QuaternionToAxisAngle(Quaternion q, Vector3 *OUTPUT, float *OUTPUT);
%include "raymath.h"
#endif // SWIGRAYLIB_EXPOSE_RAYMATH
//rlgl.h
#ifdef SWIGRAYLIB_EXPOSE_RLGL
// Remember that interops between Lua and C via SWIG is somewhat costly;
// instead of using the solution here, you really should write C functions if you can!
// If you must use Lua to call rlgl.h functions, you may want to use carray.i functions as well,
// which allow you to set up buffer memories for the arguments, to save interop counts.
%include "rlgl.h"
#endif // SWIGRAYLIB_EXPOSE_RLGL
#ifdef TRACELOG //Fix "TRACELOG" redefined error in SWIG
#undef TRACELOG
#endif
#ifdef PHYSAC_IMPLEMENTATION
%include "extras/physac.h"
#endif // PHYSAC_IMPLEMENTATION
//------
// Helper functions
//------
%inline %{
//raylib.h
void *_SWIGExtra_RL_MALLOC(size_t size){
return RL_MALLOC(size);
};
void *_SWIGExtra_RL_CALLOC(size_t n, size_t size){
return RL_CALLOC(n, size);
};
void *_SWIGExtra_RL_REALLOC(void *mem, size_t size){
return RL_REALLOC(mem, size);
};
void _SWIGExtra_RL_FREE(void *mem){
RL_FREE(mem);
};
void _SWIGExtra_DrawTexturePoly_ArgRearrange(Texture2D texture, Vector2 center, Vector2 *points, int pointsCount, Vector2 *texcoords, int texcoordsCount, Color tint){
(void)texcoordsCount;
DrawTexturePoly(texture, center, points, texcoords, pointsCount, tint);
};
GlyphInfo *_SWIGExtra_LoadFontData_ArgRearrange(const unsigned char *fileData, int dataSize, int fontSize, int *fontChars, int glyphCount, int type, int *glyphCount_out){
*glyphCount_out = glyphCount;
return LoadFontData(fileData, dataSize, fontSize, fontChars, glyphCount, type);
};
Image _SWIGExtra_GenImageFontAtlas_ArgRearrange(const GlyphInfo *chars, int glyphCount, int fontSize, int padding, int packMethod, Rectangle **recs, int *glyphCount_out){
*glyphCount_out = glyphCount;
return GenImageFontAtlas(chars, recs, glyphCount, fontSize, padding, packMethod);
};
char *_SWIGExtra_CodepointToUTF8_WithNullTerm(int codepoint){
int len;
const char *utf8 = CodepointToUTF8(codepoint, &len);
char *utf8NullTerm = (char *)malloc((len+1)*sizeof(char));
memcpy(utf8NullTerm, utf8, len*sizeof(char));
utf8NullTerm[len] = '\0';
return utf8NullTerm;
};
//raymath.h (Useful juices. No need to wrap these between conditional macros)
float *_SWIGExtra_MatrixToFloat(Matrix mat){
float* copy = (float*)malloc(16*sizeof(float));
memcpy(copy, MatrixToFloat(mat), 16*sizeof(float));
return copy;
};
float *_SWIGExtra_Vector3ToFloat(Vector3 vec){
float* copy = (float*)malloc(3*sizeof(float));
memcpy(copy, Vector3ToFloat(vec), 3*sizeof(float));
return copy;
};
%}
//------
// Macros and aliases
//------
#ifdef SWIGLUA
%define REG_COLOR(colorName)
%inline %{ Color _SWIGExtra_get_##colorName(){ return colorName; } %}
%luacode %{ _swig[#colorName] = _swig._SWIGExtra_get_##colorName() %}
%enddef
%define REG_ALIAS(dest, source)
%luacode %{ _swig[#dest] = _swig[#source] %}
%enddef
%define REG_MACRO_OPTION(macroName)
#if defined(##macroName##)
%inline %{ const int _SWIGExtra_##macroName = 1; %}
#else
%inline %{ const int _SWIGExtra_##macroName = 0; %}
#endif
%luacode %{ _swig[#macroName] = _swig._SWIGExtra_##macroName %}
%enddef
#endif
//colors
REG_COLOR(LIGHTGRAY)
REG_COLOR(GRAY)
REG_COLOR(DARKGRAY)
REG_COLOR(YELLOW)
REG_COLOR(GOLD)
REG_COLOR(ORANGE)
REG_COLOR(PINK)
REG_COLOR(RED)
REG_COLOR(MAROON)
REG_COLOR(GREEN)
REG_COLOR(LIME)
REG_COLOR(DARKGREEN)
REG_COLOR(SKYBLUE)
REG_COLOR(BLUE)
REG_COLOR(DARKBLUE)
REG_COLOR(PURPLE)
REG_COLOR(VIOLET)
REG_COLOR(DARKPURPLE)
REG_COLOR(BEIGE)
REG_COLOR(BROWN)
REG_COLOR(DARKBROWN)
REG_COLOR(WHITE)
REG_COLOR(BLACK)
REG_COLOR(BLANK)
REG_COLOR(MAGENTA)
REG_COLOR(RAYWHITE)
//macro and typedef aliases
REG_MACRO_OPTION(PLATFORM_DESKTOP)
REG_MACRO_OPTION(PLATFORM_ANDROID)
REG_MACRO_OPTION(PLATFORM_RPI)
REG_MACRO_OPTION(PLATFORM_DRM)
REG_MACRO_OPTION(PLATFORM_WEB)
REG_ALIAS(Quaternion, Vector4)
REG_ALIAS(Texture2D, Texture)
REG_ALIAS(TextureCubemap, Texture)
REG_ALIAS(RenderTexture2D, RenderTexture)
REG_ALIAS(Camera, Camera3D)
REG_ALIAS(MOUSE_LEFT_BUTTON, MOUSE_BUTTON_LEFT)
REG_ALIAS(MOUSE_RIGHT_BUTTON, MOUSE_BUTTON_RIGHT)
REG_ALIAS(MOUSE_MIDDLE_BUTTON, MOUSE_BUTTON_MIDDLE)
REG_ALIAS(MATERIAL_MAP_DIFFUSE, MATERIAL_MAP_ALBEDO)
REG_ALIAS(MATERIAL_MAP_SPECULAR, MATERIAL_MAP_METALNESS)
REG_ALIAS(SHADER_LOC_MAP_DIFFUSE, SHADER_LOC_MAP_ALBEDO)
REG_ALIAS(SHADER_LOC_MAP_SPECULAR, SHADER_LOC_MAP_METALNESS)
//swig extras
REG_ALIAS(RL_MALLOC, _SWIGExtra_RL_MALLOC)
REG_ALIAS(RL_CALLOC, _SWIGExtra_RL_CALLOC)
REG_ALIAS(RL_REALLOC, _SWIGExtra_RL_REALLOC)
REG_ALIAS(RL_FREE, _SWIGExtra_RL_FREE)
REG_ALIAS(CodepointToUTF8, _SWIGExtra_CodepointToUTF8_WithNullTerm)
REG_ALIAS(MatrixToFloat, _SWIGExtra_MatrixToFloat)
REG_ALIAS(Vector3ToFloat, _SWIGExtra_Vector3ToFloat)
//------
// Lua wrapper functions
//------
#ifdef SWIGLUA
%luacode %{
package.loaded[_moduleName] = _swig
local _arrayGetterMapping = {
["int"] = _swig.IntArray_getitem,
["float"] = _swig.FloatArray_getitem,
["charP"] = _swig.CharPArray_getitem,
["Color"] = _swig.ColorArray_getitem,
["GlyphInfo"] = _swig.GlyphInfoArray_getitem,
["Rectangle"] = _swig.RectangleArray_getitem,
["Material"] = _swig.MaterialArray_getitem,
["ModelAnimation"] = _swig.ModelAnimationArray_getitem,
}
local function _CArrayToLuaTab(arrayType, cArray, len)
local tab = {}
local getter = _arrayGetterMapping[arrayType]
for i = 1, len do
tab[i] = getter(cArray, i-1)
end
return tab
end
local _originals = {}
do
local copylist = {
"Vector2",
"Vector3",
"Vector4",
"Color",
"Rectangle",
"Ray",
"BoundingBox",
"GetDirectoryFiles",
"GetDroppedFiles",
"LoadImageColors",
"LoadImagePalette",
"UnloadImageColors",
"UnloadImagePalette",
"DrawTexturePoly",
"LoadFontData",
"UnloadFontData",
"GenImageFontAtlas",
"LoadCodepoints",
"UnloadCodepoints",
"LoadMaterials",
"LoadModelAnimations",
"UnloadModelAnimations",
"MatrixToFloat",
"Vector3ToFloat"
}
for i = 1, #copylist do _originals[copylist[i]] = _swig[copylist[i]] end
end
function _swig.Vector2(x, y)
local vec = _originals.Vector2()
if x then vec.x, vec.y = x, y end
return vec
end
function _swig.Vector3(x, y, z)
local vec = _originals.Vector3()
if x then vec.x, vec.y, vec.z = x, y, z end
return vec
end
function _swig.Vector4(x, y, z, w)
local vec = _originals.Vector4()
if x then vec.x, vec.y, vec.z, vec.w = x, y, z, w end
return vec
end
_swig.Quaternion = _swig.Vector4
function _swig.Color(r, g, b, a)
local col = _originals.Color()
if r then col.r, col.g, col.b = r, g, b end
if a then col.a = a end
return col
end
function _swig.Rectangle(x, y, w, h)
local rect = _originals.Rectangle()
if x then rect.x, rect.y = x, y end
if w then rect.width, rect.height = w, h end
return rect
end
function _swig.Ray(position, direction)
local ray = _originals.Ray()
if position then ray.position = position end
if direction then ray.direction = direction end
return ray
end
function _swig.BoundingBox(min, max)
local box = _originals.BoundingBox()
if min then box.min, box.max = min, max end
return box
end
function _swig.GetDirectoryFiles(dirPath)
return _CArrayToLuaTab("charP", _originals.GetDirectoryFiles(dirPath))
end
function _swig.GetDroppedFiles()
return _CArrayToLuaTab("charP", _originals.GetDroppedFiles())
end
function _swig.LoadImageColors(image)
return _CArrayToLuaTab("Color", _originals.LoadImageColors(image), image.width*image.height)
end
function _swig.LoadImagePalette(image, maxPaletteSize)
return _CArrayToLuaTab("Color", _originals.LoadImagePalette(image, maxPaletteSize))
end
function _swig.UnloadImageColors(colors)
return _originals.UnloadImageColors(colors[1])
end
function _swig.UnloadImagePalette(colors)
return _originals.UnloadImagePalette(colors[1])
end
function _swig.DrawTexturePoly(texture, center, points, texcoords, tint)
return _originals._SWIGExtra_DrawTexturePoly_ArgRearrange(texture, center, points, texcoords, tint)
end
function _swig.LoadFontData(fileData, dataSize, fontSize, fontChars, type)
return _CArrayToLuaTab("GlyphInfo", _originals._SWIGExtra_LoadFontData_ArgRearrange(fileData, dataSize, fontSize, fontChars, type))
end
function _swig.UnloadFontData(glyphInfos)
return _originals.UnloadFontData(glyphInfos[1], #glyphInfos)
end
function _swig.GenImageFontAtlas(chars, fontSize, padding, packMethod)
local image, recs, glyphCount = _originals._SWIGExtra_GenImageFontAtlas_ArgRearrange(chars, fontSize, padding, packMethod)
return image, _CArrayToLuaTab("Rectangle", recs, glyphCount)
end
function _swig.LoadCodepoints(text)
return _CArrayToLuaTab("int", _originals.LoadCodepoints(text))
end
function _swig.UnloadCodepoints(codepoints)
return _originals.UnloadCodepoints(codepoints, #codepoints)
end
function _swig.LoadMaterials(fileName)
return _CArrayToLuaTab("Material", _originals.LoadMaterials(fileName))
end
function _swig.LoadModelAnimations(fileName)
return _CArrayToLuaTab("ModelAnimation", _originals.LoadModelAnimations(fileName))
end
function _swig.UnloadModelAnimations(animations)
return _originals.UnloadModelAnimations(animations[1], #animations)
end
function _swig.MatrixToFloat(matrix)
return _CArrayToLuaTab("float", _originals.MatrixToFloat(matrix), 16)
end
function _swig.Vector3ToFloat(vector3)
return _CArrayToLuaTab("float", _originals.Vector3ToFloat(vector3), 3)
end
%}
#endif