LUA 5.2 wrapper

Previous topic - Next topic

Albert

This is my attempt to embed LUA into glBasic in a cross-platform cross-compile way.

Tested in Windows and Android.
Added only some of the LUA commands, and a little set of GLBasic commands for testing purposes.
I hope that one of you interested in and have enough knowledge (more than me) to fix and extend this little sample.

Download with source: https://dl.dropbox.com/u/292449/glbasic/lua/lua1.zip
Install on Android: https://dl.dropbox.com/u/292449/glbasic/lua/lua1.apk


MrTAToad

Will be interesting to know if it compiles on a Mac too

Albert

Please sbody try to compile to various platforms and test it. iPhone, linux, MacOS are the main platforms i want to know if compatible

Tapatalk 2-vel küldve az én GT-I9000-ről

MrTAToad

#3
I'll try Linux later on...

Bad news - as it standards, it won't compile - it doesn't find the header files unfortunately.

trucidare

anyone using linux should provide the current headers. so lua will compile fine on linux - on osx is a bit tricky but possible.
MacBook Pro 2,2 GHz Core 2 Duo, 4 GB RAM, 160 GB HDD, 8600M GT
Core i3 - 3,07 GHz, 8 GB Ram, 2.5 TB HDD, Geforce GTX 260+ OC

MrTAToad

Problem is it wont compile :

Code (glbasic) Select
/cygdrive/C/Users/Nicholas/AppData/Local/Temp/glbasic/gpc_temp1.cpp:54:18: math.h: No such file or directory
In file included from /cygdrive/C/Users/Nicholas/Desktop/lua/src/lapi.c:14,
                 from /cygdrive/C/Users/Nicholas/AppData/Local/Temp/glbasic/gpc_temp1.cpp:56:
/cygdrive/C/Users/Nicholas/Desktop/lua/src/lua.h:12:20: stdarg.h: No such file or directory
/cygdrive/C/Users/Nicholas/Desktop/lua/src/lua.h:13:20: stddef.h: No such file or directory
In file included from /cygdrive/C/Users/Nicholas/Desktop/lua/src/lua.h:16,
                 from /cygdrive/C/Users/Nicholas/Desktop/lua/src/lapi.c:14,
                 from /cygdrive/C/Users/Nicholas/AppData/Local/Temp/glbasic/gpc_temp1.cpp:56:
/cygdrive/C/Users/Nicholas/Desktop/lua/src/luaconf.h:11:20: limits.h: No such file or directory
/cygdrive/C/Users/Nicholas/Desktop/lua/src/luaconf.h:12:20: stddef.h: No such file or directory


I have come across this when using some code with Android - it looks like the compiler believes the path for the headers and code is different from it should be.

Albert

Add to the compiler options:
Code (glbasic) Select
-I"%PROJECT_PATH%\include\linux" -I"%PROJECT_PATH%\include"
These are mingw win32 headers from the glBasic header rar. But I have a lot of problems with them :(

Albert

you can add additional headers into the directory: include\linux

Albert

#8
I've needed to add big subset of glbasic header.rar and a #define LUA_USE_LINUX
Somebody please check this on linux:
https://dl.dropbox.com/u/292449/glbasic/lua/lua_linux.zip

Update: Somebody verified it"s works under linux!

Albert

#9
Screenshot from linux version.
Also I've updated the zip in the first post


MrTAToad

Still having trouble getting it to compile for Linux...  Just wont find the headers for some reason...

erico

If you guys would pardon the naive question...

What would be in for having LUA with GLBasic?

Within the little I know, lua is a script language widely used by other applications, like gfx or 3d applications.
What would be the benefits down to GLB?

MrTAToad

Scripting allows a program to be controlled with external code - I want to include a scripting system in TSetup which will allow control of sprites (movement, scaling etc) and text.

erico

ok, sounds promising! :good:

Albert

Ok now I downloaded the lua1.rar to a second laptop, and tried to compile to linux, I have one compiler error, limits.h not found, strange 'cos there are 2 of them already, but in the limits.h there is this row:
Code (glbasic) Select
#include_next "limits.h"
never seemed include_next before, but google says that the compiler look further in the include directories to a secondary limits.h file.
I will check it out today.