1
0
Fork 0
mirror of https://github.com/bjornbytes/lovr.git synced 2024-07-05 05:53:33 +00:00
lovr/src/api.h

120 lines
4.5 KiB
C
Raw Normal View History

2017-03-11 11:08:07 +00:00
#include "luax.h"
#include "data/blob.h"
2018-07-26 21:02:54 +00:00
#include "event/event.h"
2017-03-11 22:13:49 +00:00
#include "graphics/mesh.h"
2017-03-11 11:08:07 +00:00
#include "math/math.h"
2017-07-27 05:02:17 +00:00
#include "math/randomGenerator.h"
2017-05-19 21:04:34 +00:00
#include "physics/physics.h"
2017-03-11 11:08:07 +00:00
2018-01-21 22:20:06 +00:00
// Module loaders
2018-02-17 17:18:08 +00:00
int l_lovrInit(lua_State* L);
2017-03-11 11:08:07 +00:00
int l_lovrAudioInit(lua_State* L);
2018-01-16 07:13:26 +00:00
int l_lovrDataInit(lua_State* L);
2017-03-11 11:08:07 +00:00
int l_lovrEventInit(lua_State* L);
int l_lovrFilesystemInit(lua_State* L);
int l_lovrGraphicsInit(lua_State* L);
int l_lovrHeadsetInit(lua_State* L);
int l_lovrMathInit(lua_State* L);
2017-05-16 04:59:53 +00:00
int l_lovrPhysicsInit(lua_State* L);
2018-02-12 04:34:32 +00:00
int l_lovrThreadInit(lua_State* L);
2017-03-11 11:08:07 +00:00
int l_lovrTimerInit(lua_State* L);
2018-01-21 22:20:06 +00:00
// Modules
2018-02-17 17:18:08 +00:00
extern const luaL_Reg lovr[];
2017-03-11 11:08:07 +00:00
extern const luaL_Reg lovrAudio[];
2018-01-21 22:20:06 +00:00
extern const luaL_Reg lovrData[];
extern const luaL_Reg lovrEvent[];
extern const luaL_Reg lovrFilesystem[];
extern const luaL_Reg lovrGraphics[];
extern const luaL_Reg lovrHeadset[];
extern const luaL_Reg lovrMath[];
extern const luaL_Reg lovrPhysics[];
2018-02-12 04:34:32 +00:00
extern const luaL_Reg lovrThreadModule[];
2018-01-21 22:20:06 +00:00
extern const luaL_Reg lovrTimer[];
// Objects
extern const luaL_Reg lovrAnimator[];
2018-01-21 21:26:00 +00:00
extern const luaL_Reg lovrAudioStream[];
extern const luaL_Reg lovrBallJoint[];
2018-01-14 21:35:57 +00:00
extern const luaL_Reg lovrBlob[];
2017-05-16 21:37:05 +00:00
extern const luaL_Reg lovrBoxShape[];
2017-12-07 07:50:52 +00:00
extern const luaL_Reg lovrCanvas[];
2017-05-16 21:52:41 +00:00
extern const luaL_Reg lovrCapsuleShape[];
2018-02-18 00:51:32 +00:00
extern const luaL_Reg lovrChannel[];
2017-03-11 11:08:07 +00:00
extern const luaL_Reg lovrController[];
2017-05-16 21:56:20 +00:00
extern const luaL_Reg lovrCylinderShape[];
2017-05-20 02:11:58 +00:00
extern const luaL_Reg lovrCollider[];
2017-06-10 22:13:19 +00:00
extern const luaL_Reg lovrDistanceJoint[];
2017-03-11 11:08:07 +00:00
extern const luaL_Reg lovrFont[];
2017-05-25 07:48:02 +00:00
extern const luaL_Reg lovrHingeJoint[];
extern const luaL_Reg lovrJoint[];
2017-10-21 21:05:58 +00:00
extern const luaL_Reg lovrMaterial[];
2017-03-11 22:13:49 +00:00
extern const luaL_Reg lovrMesh[];
extern const luaL_Reg lovrMicrophone[];
2017-03-11 11:08:07 +00:00
extern const luaL_Reg lovrModel[];
2018-01-23 02:24:39 +00:00
extern const luaL_Reg lovrModelData[];
2017-07-27 05:02:17 +00:00
extern const luaL_Reg lovrRandomGenerator[];
2018-01-22 16:40:47 +00:00
extern const luaL_Reg lovrRasterizer[];
2017-03-11 11:08:07 +00:00
extern const luaL_Reg lovrShader[];
extern const luaL_Reg lovrShaderBlock[];
2017-05-16 21:37:05 +00:00
extern const luaL_Reg lovrShape[];
2017-05-25 07:48:02 +00:00
extern const luaL_Reg lovrSliderJoint[];
2018-07-06 03:23:46 +00:00
extern const luaL_Reg lovrSoundData[];
2017-03-11 11:08:07 +00:00
extern const luaL_Reg lovrSource[];
2017-05-16 21:21:10 +00:00
extern const luaL_Reg lovrSphereShape[];
2017-03-11 11:08:07 +00:00
extern const luaL_Reg lovrTexture[];
2018-01-21 05:33:09 +00:00
extern const luaL_Reg lovrTextureData[];
2018-02-12 07:03:43 +00:00
extern const luaL_Reg lovrThread[];
2017-03-11 11:08:07 +00:00
extern const luaL_Reg lovrTransform[];
2018-02-11 01:27:29 +00:00
extern const luaL_Reg lovrVertexData[];
2017-05-16 05:02:08 +00:00
extern const luaL_Reg lovrWorld[];
2017-03-11 11:08:07 +00:00
2018-01-21 22:20:06 +00:00
// Enums
2018-07-05 03:11:52 +00:00
extern const char* ArcModes[];
extern const char* AttributeTypes[];
extern const char* BlendAlphaModes[];
extern const char* BlendModes[];
extern const char* BufferUsages[];
2018-07-05 03:11:52 +00:00
extern const char* CompareModes[];
extern const char* ControllerAxes[];
extern const char* ControllerButtons[];
extern const char* ControllerHands[];
extern const char* DrawModes[];
extern const char* EventTypes[];
extern const char* FilterModes[];
extern const char* HeadsetDrivers[];
extern const char* HeadsetEyes[];
extern const char* HeadsetOrigins[];
extern const char* HeadsetTypes[];
extern const char* HorizontalAligns[];
extern const char* JointTypes[];
extern const char* MaterialColors[];
extern const char* MaterialScalars[];
extern const char* MaterialTextures[];
extern const char* MeshDrawModes[];
extern const char* ShapeTypes[];
2018-07-06 05:08:14 +00:00
extern const char* SourceTypes[];
2018-07-05 03:11:52 +00:00
extern const char* StencilActions[];
extern const char* TextureFormats[];
extern const char* TextureTypes[];
extern const char* TimeUnits[];
extern const char* VerticalAligns[];
extern const char* Windings[];
extern const char* WrapModes[];
2017-03-11 11:08:07 +00:00
2018-01-21 22:20:06 +00:00
// Shared helpers
int luax_loadvertices(lua_State* L, int index, VertexFormat* format, VertexPointer vertices);
bool luax_checkvertexformat(lua_State* L, int index, VertexFormat* format);
2018-01-27 21:43:20 +00:00
int luax_pushvertexformat(lua_State* L, VertexFormat* format);
2018-02-11 01:27:29 +00:00
int luax_pushvertexattribute(lua_State* L, VertexPointer* vertex, Attribute attribute);
int luax_pushvertex(lua_State* L, VertexPointer* vertex, VertexFormat* format);
void luax_setvertexattribute(lua_State* L, int index, VertexPointer* vertex, Attribute attribute);
void luax_setvertex(lua_State* L, int index, VertexPointer* vertex, VertexFormat* format);
int luax_readtransform(lua_State* L, int index, mat4 transform, int scaleComponents);
2017-04-02 12:55:21 +00:00
Blob* luax_readblob(lua_State* L, int index, const char* debug);
2017-07-27 05:02:17 +00:00
Seed luax_checkrandomseed(lua_State* L, int index);
2018-07-26 21:02:54 +00:00
void luax_checkvariant(lua_State* L, int index, Variant* variant);
int luax_pushvariant(lua_State* L, Variant* variant);
int luax_checkuniform(lua_State* L, int index, const Uniform* uniform, void* dest, const char* debug);
void luax_checkuniformtype(lua_State* L, int index, UniformType* baseType, int* components);