Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
stetre committed Feb 20, 2016
0 parents commit 87be570
Show file tree
Hide file tree
Showing 43 changed files with 7,074 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
*.log
core.*
local/
28 changes: 28 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
The MIT License (MIT)

Copyright (c) 2016 Stefano Trettel

Software repository: MoonGLFW, https://github.com/stetre/moonglfw

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.


(See also the THIRD-PARTY LICENSES contained in the thirdparty/ directory
of the Software repository.)

21 changes: 21 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@

default: build

check:
@cd src; $(MAKE) -s $@

build:
@cd src; $(MAKE) $@

install:
@cd src; $(MAKE) $@

clean :
@cd src; $(MAKE) $@
@cd doc; $(MAKE) $@
# @cd examples; $(MAKE) $@
# @cd tests; $(MAKE) $@

cleanall: clean

backup: clean
50 changes: 50 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
##MoonGLFW: Lua bindings for GLFW

MoonGLFW is a Lua binding library for [GLFW](http://www.glfw.org/).

It runs on GNU/Linux and requires [Lua](http://www.lua.org/) (>=5.3)
and [GLFW](http://www.glfw.org/download.html) (>=3.1).

_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, Getting and installing, etc.

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

#### Example

```lua
-- Script: hello.lua

glfw = require("moonglfw")

-- Create a window:
window = glfw.create_window(640, 480, "Hello world!")

function my_callback(w, x, y)
assert(w == window)
print("cursor position:", x, y)
end

-- Register a callback to track the cursor's position:
glfw.set_cursor_pos_callback(window, my_callback)

-- Repeatedly poll for events:
while not glfw.window_should_close(window) do
glfw.poll_events()
end
```

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.
53 changes: 53 additions & 0 deletions doc/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
TgtAdoc := index
TgtPdf := MoonGLFW-RefMan

Stylesdir = ./
Stylesheet = colony.css
Style = -a stylesheet=$(Stylesheet) -a stylesdir=$(Stylesdir)
Style =

ifdef TgtAdoc
# one file only
Src = $(TgtAdoc).adoc
else
# all .adoc files
Src := $(wildcard *.adoc)
endif

Xml := $(Src:.adoc=.xml)
Html := $(Src:.adoc=.html)
Pdf := $(Src:.adoc=.pdf)

default: html

check:

clean:
@-rm -f *~
@-rm -f *.pdf
@-rm -f *.pdfmarks
@-rm -f *.xml
@-rm -f *.html
@-rm -f *.epub
@-rm -f *.fo
@-rm -f *.log

install:

html: clean
@asciidoctor $(Style) $(Src)

preview: html
@google-chrome $(Html)

ifdef TgtAdoc
# one file only
pdf: clean
@asciidoctor-pdf $(TgtAdoc).adoc -o $(TgtPdf).pdf
else
# all .adoc files
pdf: clean
@asciidoctor-pdf -a pdf-style=asciidoctor $(TgtAdoc).adoc
endif

docs: html pdf
19 changes: 19 additions & 0 deletions doc/bindings.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@

== Bindings

The structure of this section purposedly replicates the structure of the
http://www.glfw.org/docs/latest/modules.html[GLFW Reference documentation].

include::context.adoc[]

include::initialization.adoc[]

include::input.adoc[]

include::monitor.adoc[]

include::native.adoc[]

include::window.adoc[]

<<<
Loading

0 comments on commit 87be570

Please sign in to comment.