All Projects → stetre → moongl

stetre / moongl

Licence: other
Lua bindings for OpenGL

Programming Languages

c
50402 projects - #5 most used programming language
lua
6591 projects
Makefile
30231 projects

Projects that are alternatives of or similar to moongl

moonvulkan
Lua bindings for Vulkan
Stars: ✭ 31 (-63.53%)
Mutual labels:  lua-bindings
lcurses
Lua bindings for Curses
Stars: ✭ 60 (-29.41%)
Mutual labels:  lua-bindings
lua-fltk4lua
Lua binding to the Fast Light Tool Kit (FLTK)
Stars: ✭ 51 (-40%)
Mutual labels:  lua-bindings
LuaCSP
Communicating Sequential Processes in Lua
Stars: ✭ 40 (-52.94%)
Mutual labels:  lua-bindings
Sol2
Sol3 (sol2 v3.0) - a C++ <-> Lua API wrapper with advanced features and top notch performance - is here, and it's great! Documentation:
Stars: ✭ 2,791 (+3183.53%)
Mutual labels:  lua-bindings
Ip2region
Ip2region is a offline IP location library with accuracy rate of 99.9% and 0.0x millseconds searching performance. DB file is ONLY a few megabytes with all IP address stored. binding for Java,PHP,C,Python,Nodejs,Golang,C#,lua. Binary,B-tree,Memory searching algorithm
Stars: ✭ 9,836 (+11471.76%)
Mutual labels:  lua-bindings
luaRtAudio
RtAudio + libsndfile lua binding
Stars: ✭ 18 (-78.82%)
Mutual labels:  lua-bindings
Unity-Lua
A wrapper around MoonSharp that allows easy development of moddable Unity games
Stars: ✭ 105 (+23.53%)
Mutual labels:  lua-bindings
lua-leveldb
Lua bindings for google's leveldb library.
Stars: ✭ 50 (-41.18%)
Mutual labels:  lua-bindings
lua-linenoise
Lua bindings for linenoise with UTF-8 support (https://github.com/yhirose/linenoise/tree/utf8-support)
Stars: ✭ 43 (-49.41%)
Mutual labels:  lua-bindings

MoonGL: Lua bindings for OpenGL

MoonGL is a Lua binding library for OpenGL.

It runs on GNU/Linux, MacOS, and on Windows (MSYS2/MinGW) and requires Lua (>=5.3), OpenGL (>=3.3), and GLEW.

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/moongl
$ cd moongl
moongl$ make
moongl$ make install # or 'sudo make install' (Ubuntu and MacOS)

Example

Below is an "Hello, World!" example, using MoonGLFW as windowing library.

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

-- Script: hello.lua

gl = require("moongl")
glfw = require("moonglfw")

glfw.window_hint('context version major', 3)
glfw.window_hint('context version minor', 3)
glfw.window_hint('opengl profile', 'core')

window = glfw.create_window(600, 400, "Hello, World!")
glfw.make_context_current(window)
gl.init() -- this is actually glewInit()

function reshape(_, w, h) 
   print("window reshaped to "..w.."x"..h)
   gl.viewport(0, 0, w, h)
end

glfw.set_window_size_callback(window, reshape)

while not glfw.window_should_close(window) do
   glfw.poll_events()
   -- ... rendering code goes here ...
   gl.clear_color(1.0, 0.5, 0.2, 1.0) -- GLFW orange
   gl.clear("color", "depth")
   glfw.swap_buffers(window)
end

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

$ lua hello.lua

See also

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].