Coder Social home page Coder Social logo

malkia / ufo Goto Github PK

View Code? Open in Web Editor NEW
242.0 28.0 28.0 270.55 MB

Portable distribution of LuaJIT with precompiled binaries, libraries and FFI bindings

Emacs Lisp 0.01% Perl 3.46% Shell 1.82% C++ 15.25% C 29.33% Objective-C 0.41% Erlang 0.12% Lua 49.61%

ufo's Introduction

----------------------------------------------------------------
-                                                              -
-                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.


ufo's People

Contributors

davidhollander avatar humbletim avatar malkia avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ufo's Issues

use stable versions only

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.

DevIL Examples

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

Update to LuaJIT-2.0.0

LuaJit is out of Beta, so maybe switching to the stable release would be appropiate. Cheers!

glfw input callbacks

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

Suggestion to build LuaJIT with Lua 5.2 features

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:

  • __len metamethod working on tables
  • __pairs and __ipairs metamethods

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.

Regal naming convention

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.

  • Nigel

samples/test.lua: The specified procedure could not be found.

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))

zlib.lua fails on Linux

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]).

apr testdir.lua, Segmentation fault: 11 on OSX

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

SDL Binding Error

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.

lua_getupvalue does nothing

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?

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.