Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
Sunjammer authored Apr 10, 2018
1 parent a76875b commit 74dc67b
Showing 1 changed file with 35 additions and 1 deletion.
36 changes: 35 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,38 @@
# linc_glfw
GLFW bindings for Haxe

Intended to serve as an alternative to linc_sdl for minimal windowing/glcontext/input bootstrapping on OSX and Windows. Bindings will be developed according to this scenario.
## Overview (verbatim from [glfw.org](http://glfw.org))
GLFW is an Open Source, multi-platform library for OpenGL, OpenGL ES and Vulkan development on the desktop. It provides a simple API for creating windows, contexts and surfaces, receiving input and events.

GLFW is written in C and has native support for Windows, macOS and many Unix-like systems using the X Window System, such as Linux and FreeBSD.

GLFW is licensed under the zlib/libpng license.

## Motivation
The linc_sdl bindings are excellent and cover significant ground in game development. However, for some scenarios GLFW is by far the lighter and more direct alternative for windowing, input and OGL rendering. These Haxe bindings enable the creation of a window and opengl context + event loop on windows and osx in the following lines:

```Haxe
import glfw.GLFW.*;
class Test {
public static function main(){
if(glfwInit() != 0){
var window = glfwCreateWindow(640, 480, "Hello World", null, null);
glfwMakeContextCurrent(window);
while (glfwWindowShouldClose(window) != GLFW_TRUE)
{
glfwPollEvents();
// Render here
}
}else{
throw 'GLFW init fail';
}
}
}
```

The bindings are written according to the [linc guidelines](http://snowkit.github.io/linc/), meaning knowledge gleaned from the [official docs](http://www.glfw.org/documentation.html) should apply directly to your Haxe source.

These bindings are written in a style that foregoes non-c++ targets, meaning liberal reliance on the cpp namespace and hxcpp types. Expect to see (and have to deal with) cpp.Pointers where the official docs specify pointer types.

0 comments on commit 74dc67b

Please sign in to comment.