Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/stetre/moonglut

Lua bindings for FreeGLUT
https://github.com/stetre/moonglut

Last synced: about 2 months ago
JSON representation

Lua bindings for FreeGLUT

Awesome Lists containing this project

README

        

## MoonGLUT: Lua bindings for FreeGLUT

_*** This project is discontinued, superseded by
[MoonGLFW](https://github.com/stetre/moonglfw). ***_

---
MoonGLUT is a Lua binding library for [FreeGLUT](http://freeglut.sourceforge.net/).

It runs on GNU/Linux and on Windows (MSYS2/MinGW) and requires
[Lua](http://www.lua.org/) (>=5.3)
and [FreeGLUT](http://freeglut.sourceforge.net/index.php#download) (>=3.0.0).

_Authored by:_ _[Stefano Trettel](https://www.linkedin.com/in/stetre)_

[![Lua logo](./doc/powered-by-lua.gif)](http://www.lua.org/)

#### License

MIT/X11 license (same as Lua). See [LICENSE](./LICENSE).

#### Documentation

See the [Reference Manual](https://stetre.github.io/moonglut/doc/index.html).

#### Getting and installing

Setup the build environment as described [here](https://github.com/stetre/moonlibs), then:

```sh
$ git clone https://github.com/stetre/moonglut
$ cd moonglut
moonglut$ make
moonglut$ make install # or 'sudo make install' (Ubuntu)
```

#### Example

```lua
-- Script: hello.lua

glut = require("moonglut")

glut.init(arg)
glut.init_context(3, 3, "core")
glut.init_display_mode("rgb", "double", "depth")

glut.init_window_size(400, 300)
glut.init_window_position(200, 200)
glut.create_window("Hello world!");

glut.display_func(function()
print ("rendering function")
end)

glut.main_loop()
```

The script can be executed at the shell prompt with the standard Lua interpreter:

```shell
$ lua hello.lua
```

Other examples can be found in the **examples/** directory contained in the release package.

#### See also

* [MoonLibs - Graphics and Audio Lua Libraries](https://github.com/stetre/moonlibs).