Home

Awesome

Glow

Glow is an OpenGL binding generator for Go. Glow parses the OpenGL XML API registry and the EGL XML API registry to produce a machine-generated cgo bridge between Go functions and native OpenGL functions. Glow is a fork of GoGL2.

Features:

See the open issues for caveats about the current state of the implementation.

Generated Packages

Generated OpenGL binding packages are available in the go-gl/gl repository.

Overloads

See subdirectory xml/overload for examples. The motivation here is to provide Go functions with different parameter signatures of existing OpenGL functions.

For example, glVertexAttribPointer(..., void *) cannot be used with gl.VertexAttribPointer(..., unsafe.Pointer) when using arbitrary offset values. The checkptr safeguard will abort the program when doing so. Overloads allow the creation of an additional gl.VertexAttribPointerWithOffset(..., uintptr), which calls the original OpenGL function with appropriate casts.

Custom Packages

If the prebuilt, go-gettable packages are not suitable for your needs you can build your own. For example,

go get github.com/go-gl/glow
cd $GOPATH/src/github.com/go-gl/glow
go build
./glow download
./glow generate -api=gl -version=3.3 -profile=core -remext=GL_ARB_cl_event
go install ./gl-core/3.3/gl

NOTE: You will have to provide a GitHub token (personal access or OAuth2 token) to update the XML specification files.

A few notes about the flags to generate: