Coder Social home page Coder Social logo

luajit-glfw's Introduction

LuaJIT-GLFW

LuaJIT FFI bindings for GLFW 3 and OpenGL.

This library contains everything needed to start a basic OpenGL app in Lua.

Building

LuaJIT-GLFW builds bindings from the systems OpenGL and GLFW headers, as well as an included glext.h file. 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.

Usage

To load the library, use the require function:

local luajit_glfw = require "glfw"

LuaJIT-GLFW loads the following libraries:

  • luajit_glfw.gl: OpenGL
  • luajit_glfw.glc: #defined values for OpenGL and GLFW (this must be a Lua table instead of static const values, because OpenGL uses longs in a couple of places)
  • luajit_glfw.glu: GLU
  • luajit_glfw.glfw: GLFW
  • luajit_glfw.glext: A table that, when indexed, loads and returns the specified extension function. Ex. glext.glMyExtFuncARB(p1, p2)

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 glfw_base.lua

luajit-glfw's People

Contributors

colonelthirtytwo avatar

Watchers

 avatar  avatar

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.