malkia / ufo Goto Github PK
View Code? Open in Web Editor NEWPortable distribution of LuaJIT with precompiled binaries, libraries and FFI bindings
Portable distribution of LuaJIT with precompiled binaries, libraries and FFI bindings
---------------------------------------------------------------- - - - UFO - Un Finished Object - - - ---------------------------------------------------------------- UFO is a portable distribution of LuaJIT (http://luajit.org), that includes precompiled binaries for various platforms, and FFI bindings for several open source (precompiled) libraries ---------------------------------------------------------------- Some of the bindings included are: OpenGL and glu, OpenCL, SDL, ZeroMQ, GLFW and others To fire up quickly a sample, please do: ./luajit samples/intro.lua (uses SDL) To create a world-map .pdf, .svg and .png using cairo ./luajit samples/cairo/world-map.lua Some more: ./luajit samples/glfw/moar.lua (uses OpenGL, glu, GLFW) ./luajit samples/AntTweakBar/simple.lua (AntTweakBar, others) ./luajit samples/AntTweakBar/OpenCL-info.lua ./luajit samples/OpenCL/info.lua The most excellent sol's imgui implementation notes using SDL: ./luajit samples/SDL/imgui/ch01.lua ./luajit samples/SDL/imgui/ch02.lua ./luajit samples/SDL/imgui/ch03.lua ./luajit samples/SDL/imgui/ch04.lua ./luajit samples/SDL/imgui/ch05.lua ./luajit samples/SDL/imgui/ch06.lua ------------------------------------------------------- FOR ALL LEGAL STUFF (LICENSE, COPYRIGHT, COPYLEFT, etc) PLEASE REFER TO THE doc/legal FOLDER ------------------------------------------------------- Dimiter "malkia" Stanev http://github.com/malkia/ufo P.S. There are lot of un finished "objects": bindings, samples, platforms, etc. Hopefully I would never finish it :), as I would like this experiment to be always work in progress.
To make Lua, LuaJIT and UFO more popular use only stable versions of LuaJIT. Currently UFO Windows binaries has version of 2.1.0-alpha.
Hey,
do anybody maybe have an example for DevIL image loading? Would be awesome, because I can't get it to work. โก
And thanks for all the awesome examples already, I enjoyed to execute all one by one. :-D
Regards,
kung foo man
It would be great to have LuaSocket to be included in the list of libraries.
LuaJit is out of Beta, so maybe switching to the stable release would be appropiate. Cheers!
Hi,
ufo seems like a great project. I have been fiddling around with glsw(on OSX) and I can set callbacks with ffi.cast (for example glfwSetCharCallback), but on input I get a segfault:
[...]
glfw.glfwSetCharCallback(ffi.cast("GLFWcharfun", function(w,c,a) end))
while glfw.glfwGetKey( window, glfw.GLFW_KEY_ESCAPE ) ~= glfw.GLFW_PRESS do
gl.glClear( gl.GL_COLOR_BUFFER_BIT )
glfw.glfwSwapBuffers(window)
glfw.glfwPollEvents()
end
[...]
Am I missing something?
Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0 luajit.dylib 0x00007fff04c4f16f 0x7fff04c4a000 + 20847
1 luajit.dylib 0x00007fff04c4f038 0x7fff04c4a000 + 20536
2 libunwind.dylib 0x00007fff8d3b591f _Unwind_RaiseException + 139
3 luajit.dylib 0x00007fff04c4f41a 0x7fff04c4a000 + 21530
4 luajit.dylib 0x00007fff04c4f5a3 0x7fff04c4a000 + 21923
5 luajit.dylib 0x00007fff04c503eb 0x7fff04c4a000 + 25579
6 luajit.dylib 0x00007fff04c54b63 0x7fff04c4a000 + 43875
7 luajit.dylib 0x00007fff04c5a1ed 0x7fff04c4a000 + 66029
8 luajit.dylib 0x00007fff04c4e799 0x7fff04c4a000 + 18329
9 glfw.dylib 0x000000000006634d _glfwInputChar + 109
10 glfw.dylib 0x000000000006d0ec -[GLFWContentView keyDown:] + 348
11 com.apple.AppKit 0x00007fff8ff5f7ac -[NSWindow sendEvent:] + 7430
12 com.apple.AppKit 0x00007fff8fef8a55 -[NSApplication sendEvent:] + 5593
13 glfw.dylib 0x000000000006d413 -[GLFWApplication sendEvent:] + 195
14 glfw.dylib 0x000000000006e8db _glfwPlatformPollEvents + 171
15 glfw.dylib 0x0000000000069839 glfwPollEvents + 57
16 ??? 0x00007fff3dcfffe4 0 + 140734230429668
I've recently begun using this incredibly useful set of tools for various programming endeavours; it's absolutely perfect for building a quick OpenGL demonstration.
The main issue I find with it is the lack of Lua 5.2 features, namely:
These features are not essential, but they are very convenient.
I also believe that any of the current code will be affected by the changes.
I've managed to compile LuaJIT x64 myself using the WinSDK, but it would be most helpful (for myself and others) if it were built with the flag by default.
Just a note to suggest naming the Regal libs as regal32.dll on Windows,
to correspond to the opengl32.dll naming scheme. Not a big deal,
if there is some other scheme you want to stick to.
Maybe use the one found in the wiki?
http://wiki.luajit.org/FFI-Bindings
Simple dll distribution on Windows and very useful.
Hey, i get this error for samples/test.lua:
C:\Users\Admin\Desktop\UFO>call luajit32 samples/test.lua
glBegin true cdata<void *>: 0x00421375
glBegin1 false samples/test.lua:111: cannot resolve symbol 'glBegin1':
The specified procedure could not be found.
glBegin2 false samples/test.lua:112: missing declaration for symbol 'glBegin2'
glBegin true cdata<void *>: 0x00421375
glBegin1 false nil
glBegin2 false nil
Edit: too fast, that's a forced error...
-- Print error messages
print('glBegin', pcall(function()return ffi.cast( "void*", gl.glBegin )end))
print('glBegin1', pcall(function()return ffi.cast( "void*", gl.glBegin1 )end))
print('glBegin2', pcall(function()return ffi.cast( "void*", gl.glBegin2 )end))
Probably others do as well, but I needed a complete FFI interface to zlib and found this one.
The problem is in the ffi.load
line:
local zlib = ffi.load( ffi_zlib_lib or libs[ ffi.os ][ ffi.arch ] or "z" )
It should be:
local zlib = ffi.load( ffi_zlib_lib or libs[ ffi.os ] and libs[ ffi.os ][ ffi.arch ] or "z" )
The problem should be obvious from the fix (libs[ffi.os]
not defined thus it crashes trying to access libs[ffi.os][ffi.arch]
).
Hello.
I get Segmentation fault: 11 on OSX in line: local name = ffi.string( info.name )
lualocal ffi = require( "ffi" )
local apr = require( "ffi/apr" )
assert( apr.apr_initialize() == 0 )
local pool = ffi.new( "apr_pool_t*[1]" )
assert( apr.apr_pool_create_ex( pool, nil, nil, nil ) == 0 )
local dir = ffi.new( "apr_dir_t*[1]" )
assert( apr.apr_dir_open(dir, ".", pool[0]) == 0 )
local finfo = ffi.new( "apr_finfo_t[1]" )
while apr.apr_dir_read(finfo, 0, dir[0]) == 0 do
local info = finfo[0]
local name = ffi.string( info.name )
print( name, info.size, info.csize )
if false then
local fields = { "pool", "valid", "protection", "filetype", "user", "group", "inode", "device",
"nlink", "size", "csize", "atime", "mtime", "ctime", "fname", "name", "filehand" }
for _, field in ipairs(fields) do
local v = finfo[0][field]
local v2, v3
print( field, tostring(v) )
end
print()
end
end
Using the SDL module fails with these messages on OSX Lion.
luajit[71964] <Error>: kCGErrorInvalidConnection: CGSGetCurrentCursorLocation: Invalid connection
luajit[71964] <Error>: kCGErrorFailure: Set a breakpoint @ CGErrorBreakpoint() to catch errors as they are logged.
luajit[71964] <Error>: kCGErrorInvalidConnection: CGSGetCurrentCursorLocation: Invalid connection
luajit[71964] <Error>: kCGErrorInvalidConnection: CGSNewWindowWithOpaqueShape: Invalid connection
luajit: C++ exception
It errors as soon as I call SDL_SetVideoMode.
Hi when I call lua_getupvalue, nothing gets pushed onto the stack. I wrote a test program below showing the problem, the code works with the ordinary lua 5.2.1. I built the latest luajit under linux.
How to run on Anroid device? Do I need rooted device? I have tried to make bin/Anroid/arm/luajit executable, but it says Operation not permitted. So I need to package it to .apk and then install it? I would like to reside samples or my code on SD Card outside Anroid installation Anroid/obb and Anroid/data, because I can't edit files there from non-rooted device, only through PC as USB-Flash.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.