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
|
#pragma once
enum BufferType {
BUFFER_UNSIGNED_CHAR,
BUFFER_UNSIGNED_SHORT,
BUFFER_UNSIGNED_INT,
BUFFER_CHAR,
BUFFER_SHORT,
BUFFER_INT,
BUFFER_FLOAT,
BUFFER_DOUBLE
};
typedef struct {
int type;
size_t size;
void *data;
} Buffer;
/* Global assing functions. */
void assignGlobalInt( int value, const char *name );
void assignGlobalFloat( float value, const char *name );
void assignGlobalDouble( double value, const char *name );
void assignGlobalColor( Color color, const char *name );
void assingGlobalFunction( const char *name, int ( *functionPtr )( lua_State* ) );
bool luaInit( int argn, const char **argc );
int luaTraceback( lua_State *L );
bool luaCallMain();
void luaCallProcess();
void luaCallDraw();
void luaCallExit();
void luaRegister();
void platformDefineGlobals();
void luaPlatformRegister();
/* Lua get types. */
bool uluaGetBoolean( lua_State *L, int index );
Color uluaGetColor( lua_State *L, int index );
Vector2 uluaGetVector2( lua_State *L, int index );
Vector3 uluaGetVector3( lua_State *L, int index );
Vector4 uluaGetVector4( lua_State *L, int index );
Rectangle uluaGetRectangle( lua_State *L, int index );
Quaternion uluaGetQuaternion( lua_State *L, int index );
Matrix uluaGetMatrix( lua_State *L, int index );
BoundingBox uluaGetBoundingBox( lua_State *L, int index );
Ray uluaGetRay( lua_State *L, int index );
NPatchInfo uluaGetNPatchInfo( lua_State *L, int index );
GlyphInfo uluaGetGlyphInfo( lua_State *L, int index );
BoneInfo uluaGetBoneInfo( lua_State *L, int index );
Transform uluaGetTransform( lua_State *L, int index );
Buffer* uluaGetBuffer( lua_State *L, int index );
Image* uluaGetImage( lua_State *L, int index );
Texture* uluaGetTexture( lua_State *L, int index );
RenderTexture* uluaGetRenderTexture( lua_State *L, int index );
Shader* uluaGetShader( lua_State *L, int index );
Mesh* uluaGetMesh( lua_State *L, int index );
Camera2D* uluaGetCamera2D( lua_State *L, int index );
Camera3D* uluaGetCamera3D( lua_State *L, int index );
Font* uluaGetFont( lua_State *L, int index );
Wave* uluaGetWave( lua_State *L, int index );
Sound* uluaGetSound( lua_State *L, int index );
Music* uluaGetMusic( lua_State *L, int index );
Light* uluaGetLight( lua_State *L, int index );
Material* uluaGetMaterial( lua_State *L, int index );
Model* uluaGetModel( lua_State *L, int index );
ModelAnimation* uluaGetModelAnimation( lua_State *L, int index );
rlRenderBatch* uluaGetRLRenderBatch( lua_State *L, int index );
/* Lua push types. */
void uluaPushColor( lua_State *L, Color color );
void uluaPushVector2( lua_State *L, Vector2 vector );
void uluaPushVector3( lua_State *L, Vector3 vector );
void uluaPushVector4( lua_State *L, Vector4 vector );
void uluaPushRectangle( lua_State *L, Rectangle rect );
void uluaPushQuaternion( lua_State *L, Quaternion quaternion );
void uluaPushMatrix( lua_State *L, Matrix matrix );
void uluaPushRay( lua_State *L, Ray ray );
void uluaPushRayCollision( lua_State *L, RayCollision rayCol );
void uluaPushBoundingBox( lua_State *L, BoundingBox box );
void uluaPushGlyphInfo( lua_State *L, GlyphInfo glyphInfo, Image *image );
void uluaPushBoneInfo( lua_State *L, BoneInfo boneInfo );
void uluaPushTransform( lua_State *L, Transform transform );
void uluaPushBuffer( lua_State *L, Buffer buffer );
void uluaPushImage( lua_State *L, Image image );
void uluaPushTexture( lua_State *L, Texture texture );
void uluaPushRenderTexture( lua_State *L, RenderTexture renderTexture );
void uluaPushCamera2D( lua_State *L, Camera2D camera );
void uluaPushCamera3D( lua_State *L, Camera3D camera );
void uluaPushShader( lua_State *L, Shader shader );
void uluaPushFont( lua_State *L, Font font );
void uluaPushWave( lua_State *L, Wave wave );
void uluaPushSound( lua_State *L, Sound sound );
void uluaPushMusic( lua_State *L, Music music );
void uluaPushLight( lua_State *L, Light light );
void uluaPushMaterial( lua_State *L, Material material );
void uluaPushMesh( lua_State *L, Mesh mesh );
void uluaPushModel( lua_State *L, Model model );
void uluaPushModelAnimation( lua_State *L, ModelAnimation modelAnimation );
void uluaPushRLRenderBatch( lua_State *L, rlRenderBatch renderBatch );
/* Utils. */
int uluaGetTableLen( lua_State *L, int index );
|