GithubHelp home page GithubHelp logo

moonglut's Introduction

MoonGLUT: Lua bindings for FreeGLUT

*** This project is discontinued, superseded by MoonGLFW. ***


MoonGLUT is a Lua binding library for FreeGLUT.

It runs on GNU/Linux and on Windows (MSYS2/MinGW) and requires Lua (>=5.3) and FreeGLUT (>=3.0.0).

Authored by: Stefano Trettel

Lua logo

License

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

Documentation

See the Reference Manual.

Getting and installing

Setup the build environment as described here, then:

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

Example

-- 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:

$ lua hello.lua

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

See also

moonglut's People

Contributors

stetre avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

moonglut's Issues

Freeglut error

When I try to make the library, I am met with this:

cc -O2 -Wall -Wextra -Wpedantic -std=gnu99 -DLUAVER=5.3 -DMINGW    -c -o callbacks.o callbacks.c
In file included from internal.h:34,
                 from callbacks.c:29:
moonglut.h:36:10: fatal error: GL/freeglut.h: No such file or directory
   36 | #include <GL/freeglut.h>
      |          ^~~~~~~~~~~~~~~
compilation terminated.
make[1]: *** [<builtin>: callbacks.o] Error 1
make[1]: Leaving directory '/home/chris/moonglut/src'
make: *** [Makefile:5: build] Error 2

I have made sure I have FreeGlut installed, I've tested it and built a test program, no issues at all, but for some reason it can't be found here.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.