Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/arkenidar/ffi-luajit-sdl
SDL2 * accessed from LuaJIT with the help of its FFI. (*) OpenGL also!
https://github.com/arkenidar/ffi-luajit-sdl
2d 3d ffi gl luajit maze obj opengl stl
Last synced: 7 days ago
JSON representation
SDL2 * accessed from LuaJIT with the help of its FFI. (*) OpenGL also!
- Host: GitHub
- URL: https://github.com/arkenidar/ffi-luajit-sdl
- Owner: arkenidar
- Created: 2022-11-12T06:55:00.000Z (about 2 years ago)
- Default Branch: master
- Last Pushed: 2024-01-28T12:32:06.000Z (11 months ago)
- Last Synced: 2024-12-24T08:53:49.931Z (10 days ago)
- Topics: 2d, 3d, ffi, gl, luajit, maze, obj, opengl, stl
- Language: C
- Homepage:
- Size: 7.7 MB
- Stars: 4
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
For testing and scripting I used Linuxes (Debian, Arch), and MSYS/MINGW in Windows. Looking forward for Android too (WIP).
launch with LuaJIT.org for example `luajit maze.lua`
| script | description |
|--------|-------------|
| maze.lua | 2d with input and asset loader |
| opengl.lua | 3d |
| app.lua | basic |https://luajit.org/ext_ffi.html The FFI library allows calling external C functions and using C data structures from pure Lua code.
```
some credit and further documentation:Using SDL from luajit's built-in ffi module
https://gist.github.com/creationix/1213280/a97d7051decb2f1d3e8844186bbff49b6442700a
-- load the luajit ffi module
local ffi = require "ffi"
-- Parse the C API header
-- It's generated with:
--
-- echo '#include ' > stub.c
-- gcc -I /usr/include/SDL -E stub.c | grep -v '^#' > ffi_SDL.h
--
ffi.cdef(io.open('ffi_SDL.h', 'r'):read('*a'))
-- Load the shared object
local SDL = ffi.load('SDL')
```