LuaJIT FFI bindings for GLFW 3 and OpenGL.
This library contains everything needed to start a basic OpenGL app in Lua.
LuaJIT-GLFW builds bindings from the systems OpenGL and GLFW headers, as well as an included
To build the bindings, you need to have a C preprocessor (only GCC is supported at the moment), headers for OpenGL and GLFW 3, and Python 3 installed, though the resulting
file should be cross-platform compatible.
To build with GCC, just run
build.sh in the repository directory. This will create a
glfw.lua file, which is the only file
you need to install.
To load the library, use the
local luajit_glfw = require "glfw"
LuaJIT-GLFW loads the following libraries:
#defined values for OpenGL and GLFW (this must be a Lua table instead of
static constvalues, because OpenGL uses
longsin a couple of places)
luajit_glfw.glext: A table that, when indexed, loads and returns the specified extension function. Ex.
You can also use the following snippet to concisely localize the libraries.
local gl, glc, glu, glfw, glext = luajit_glfw.libraries() -- Or if you just need the libraries: local gl, glc, glu, glfw, glext = require('glfw').libraries()
Additionally, LuaJIT-GLFW wraps GLFW functions and sets metatypes for GLFW structs for convenience. See