Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jerluc/luagl
Straight-forward LuaJIT FFI bindings for OpenGL
https://github.com/jerluc/luagl
Last synced: 24 days ago
JSON representation
Straight-forward LuaJIT FFI bindings for OpenGL
- Host: GitHub
- URL: https://github.com/jerluc/luagl
- Owner: jerluc
- Created: 2016-03-30T23:26:53.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2016-03-30T23:27:06.000Z (almost 9 years ago)
- Last Synced: 2024-11-05T20:41:24.722Z (2 months ago)
- Language: Lua
- Size: 15.6 KB
- Stars: 4
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
LuaGL
=====Straight-forward LuaJIT FFI bindings for OpenGL
Usage
=====For usage in a purely LuaJIT environment:
```lua
local gl = require("libs/gl") ("libGL.so")...
gl.Begin(gl.GL_TRIANGLES)
gl.Color3f(1., 0., 0.)
gl.Vertex3f(-0.6, -0.4, 0.)
gl.Color3f(0., 1., 0.)
gl.Vertex3f(0.6, -0.4, 0.)
gl.Color3f(0., 0., 1.)
gl.Vertex3f(0., 0.6, 0.)
gl.End()...
```However, if you intend to run your script from an embedded LuaJIT environment which has OpenGL
already linked, you can omit the library name argument from the import:```lua
local gl = require("libs/gl") ()
```