lua integration

This commit is contained in:
Dane Johnson
2021-01-13 16:47:16 -06:00
parent d5788228f6
commit 86f6203efc
16 changed files with 210 additions and 20 deletions

2
scripting/.gitignore vendored Normal file
View File

@@ -0,0 +1,2 @@
couch_wrap.cpp
couch_wrap.o

12
scripting/Makefile Normal file
View File

@@ -0,0 +1,12 @@
include ../common.mk
SWIG := swig
SWIG_OPTS := -lua
all: couch_wrap.o
couch_wrap.o: couch_wrap.cpp
$(CXX) $(CXXFLAGS) -I../core -c -o $@ $^
couch_wrap.cpp: couch.i
$(SWIG) -c++ $(SWIG_OPTS) -I../core -o $@ $^

20
scripting/couch.i Normal file
View File

@@ -0,0 +1,20 @@
%module couch
%typemap(in) cfloat {
$1 = (cfloat) lua_tonumber(L, $input);
}
%{
#include "types.h"
#include "Transform.h"
#include "Mesh.h"
#include "Ball.h"
#include "Camera.h"
extern void AddMeshToList(Mesh &mesh);
%}
%include "types.h"
%include "Transform.h"
%include "Mesh.h"
%include "Ball.h"
%include "Camera.h"
extern void AddMeshToList(Mesh &mesh);