{"id":22377510,"url":"https://github.com/james2doyle/raylib-luajit-generated","last_synced_at":"2025-04-13T00:26:59.701Z","repository":{"id":266421834,"uuid":"898305571","full_name":"james2doyle/raylib-luajit-generated","owner":"james2doyle","description":"An attempt at Raylib LuaJit bindings that are generated from the raylib-parser API docs","archived":false,"fork":false,"pushed_at":"2024-12-23T22:29:41.000Z","size":723,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-26T18:21:44.231Z","etag":null,"topics":["lua","luajit","luajit-ffi","luajit-ffi-bindings","raylib"],"latest_commit_sha":null,"homepage":"","language":"Lua","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/james2doyle.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-12-04T06:49:55.000Z","updated_at":"2025-02-01T19:23:16.000Z","dependencies_parsed_at":"2024-12-04T07:35:09.936Z","dependency_job_id":"ea552532-5bbe-4e96-9fcd-8fa6a8dcf523","html_url":"https://github.com/james2doyle/raylib-luajit-generated","commit_stats":null,"previous_names":["james2doyle/raylib-luajit-generated"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/james2doyle%2Fraylib-luajit-generated","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/james2doyle%2Fraylib-luajit-generated/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/james2doyle%2Fraylib-luajit-generated/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/james2doyle%2Fraylib-luajit-generated/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/james2doyle","download_url":"https://codeload.github.com/james2doyle/raylib-luajit-generated/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248650745,"owners_count":21139666,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["lua","luajit","luajit-ffi","luajit-ffi-bindings","raylib"],"created_at":"2024-12-04T22:14:19.334Z","updated_at":"2025-04-13T00:26:59.677Z","avatar_url":"https://github.com/james2doyle.png","language":"Lua","funding_links":[],"categories":[],"sub_categories":[],"readme":"Raylib LuaJit 5.5\n=================\n\n\u003e [Raylib](https://www.raylib.com) LuaJit bindings that are generated from the raylib-parser API docs\n\n# !! INCOMPLETE AND WORK IN PROGRESS !!\n\n- [x] `raylib.h` code-gen to lua using `raylib_api.lua`\n- [x] `rlgl.h` code-gen to lua using `rlgl_api.lua`\n- [x] `raygui.h` code-gen to lua using `raygui_api.lua`\n- [ ] `config.h` code-gen to lua using `config_api.lua`\n- [ ] `raymath.h` code-gen to lua using `raymath_api.lua`\n\n##### PROS:\n\n- Simple lua files (except for the compiled Raylib binaries/libraries/header)\n- Works as an actual lib instead of a runner\n- No build required in order to use this\n- Really easy to update\n\n##### CONS:\n\n- You need the LuaJIT and Raylib compiled binaries/libraries\n- Building a binary to distribute is a chore\n\n## Running\n\n- Install Raylib globally. I used `brew install raylib` on OSX, or\n- Download your Raylib release and toss everything from `lib/` into the `./raylib` folder\n- Create a file in the root with the following code:\n\n```lua\n-- save as main.lua\n-- run with `luajit main.lua`\nlocal rl = require('raylib')\n\nrl.SetConfigFlags(rl.FLAG_VSYNC_HINT)\n\nrl.InitWindow(800, 450, \"raylib [core] example - basic window\")\n\nwhile not rl.WindowShouldClose() do\n  rl.BeginDrawing()\n  rl.ClearBackground(rl.RAYWHITE)\n  rl.DrawText(\"Congrats! You created your first window!\", 190, 200, 20, rl.LIGHTGRAY)\n  rl.EndDrawing()\nend\n\nrl.CloseWindow()\n\n```\n\n- Run `luajit main.lua`\n\n## Examples\n\n*Examples are pulled from [TSnake41/raylib-lua](https://github.com/TSnake41/raylib-lua/tree/master/examples)*\n\nRun `luajit examples/core_basic_window.lua`\n\n## Generating API files\n\nYou can use [the Raylib parser](https://github.com/raysan5/raylib/tree/master/parser) to generate `.lua` files that document the API:\n\n```sh\n./raylib_parser -i ../src/config.h -f LUA -o config_api.lua\n./raylib_parser -i ../src/raylib.h -f LUA -o raylib_api.lua\n./raylib_parser -i ../src/raymath.h -f LUA -o raymath_api.lua\n./raylib_parser -i ../src/rlgl.h -f LUA -o rlgl_api.lua\n# requires the raygui in the raylib source folder\n./raylib_parser -i ../raygui/src/raygui.h -f LUA -o raygui_api.lua\n```\n\n## Building `raylib/init.lua` from API files\n\nThis is a work in progress as well. It uses regular Lua 5.4 to generate the file. Make sure `lpeg` is installed. You can install it with `luarocks install lpeg`.\n\nIt is super rough right now but it does work and generates a `init.lua` file with comments and [docblocks](https://stevedonovan.github.io/ldoc/manual/doc.md.html)!\n\nYou don't need Lune or Luau installed to use this library\n\n```sh\ncd raylib/\nluarocks install lpeg\nlua generate.lua\n```\n\n### Thank you to the following projects\n\nThank you to these projects that acted as a reference for this implementation\n\n- [/alexander-matz/f8ee4eb9fdf676203d70c1e5e329a6ec](https://gist.github.com/alexander-matz/f8ee4eb9fdf676203d70c1e5e329a6ec)\n- [/darltrash/raylib-luajit](https://github.com/darltrash/raylib-luajit)\n- [/RequiemSouls/raylua](https://github.com/RequiemSouls/raylua)\n- [/temperlang/temper-raylib/tree/main/vendor/raylib-luajit](https://github.com/temperlang/temper-raylib/tree/main/vendor/raylib-luajit)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjames2doyle%2Fraylib-luajit-generated","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjames2doyle%2Fraylib-luajit-generated","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjames2doyle%2Fraylib-luajit-generated/lists"}