Skip to content

The simple and easy-to-use library to enjoy videogames programming written in the speedy LuaJIT

License

Notifications You must be signed in to change notification settings

HumanBodyMacAndCheese/raylib-luajit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 

Repository files navigation

raylib-luajit

The simple and easy-to-use library to enjoy videogames programming written in the zippy LuaJIT implementation of the popular scripting language Lua


DISCLAIMER: THIS IS NOT A STABLE RELEASE AND IS HIGHLY PRONE TO BUGS. USE WITH CAUTION.


features

  • Everything that raylib 5.0 has (except for rlgl, which WILL come in an upcoming update to this binding)
  • Auto-detection of OS and raylib binary
  • One-script library
  • Automatic memory management for certain functions

build and installation

  • Simply build raylib from source as a shared library and place it in the same directory. That's it, since LuaJIT's FFI will automatically load functions for you.

basic example

package.path = "./?.lua;./?.ljbc;./?.out"		-- Optional: Set package paths to avoid conflicting with LuaRocks packages if you have LuaRocks installed

local rl = require("raylib")

rl.InitWindow(800, 600, "raylib [core] example - basic window")

while not rl.WindowShouldClose() do
	rl.BeginDrawing()
		rl.ClearBackground(rl.RAYWHITE)
		rl.DrawText("Congrats! You created your first window!", 190, 200, 20, rl.LIGHTGRAY)
	rl.EndDrawing()
end

rl.CloseWindow()