gl | OpenGL Bindings for golang
You will need GLEW at least version 1.5.8.
Once GLEW is installed, you can install this package with
go get github.com/go-gl/gl
Contact / discussion mailing list
Documentation and examples
Examples can be found in our examples repository.
More libraries: Easy windowing, meshes, text rendering, etc:
- GLFW bindings for easy windowing, input etc.
- gltext a native go library for glyph packing and text rendering
- glu GLU bindings
- glchart a go chart OpenGL backend
- gldebug graphical timing and memory debugging utilities
Problems and contributing
If you encounter any problems please file an issue. Pull requests are welcome. We're looking for contributors!
Setting your GOPATH
Operating System Specific advice
go-gl/gl authors primarily develop on Linux-based machines. The package
should work on other operating systems, if you encounter problems after following
the instructions below, please file an issue.
Linux / OSX
This package uses cgo and therefore you will need
a C compiler such as GCC. On Debian, you can install
build-essential to get this.
You need to install the GLEW development libraries the appropriate package manager for your Linux distribution or by downloading the sources from the GLEW website.
For non-standard GLEW install locations, after
go get cd to
$GOPATH/src/github.com/go-gl/gl and run:
CGO_CFLAGS="-I/path/to/includes" CGO_LDFLAGS="-L/path/to/libs" go install
You may be able to determine the appropriate flags using:
pkg-config glew --libs --cflags
Note that we import from
GL/glew.h, so if
pkg-config --cflags reports
/opt/include/GL, you may need to remove
/GL so that
GLEW from Homebrew / Macports
These can be used to install GLEW. Beware that you may need to set
CGO_LDFLAGS - the Linux instructions above are relevant.
Windows support is currently unknown.
cgo, and therefore you will
need a C compiler. If you install the GLEW to your compiler's include and lib
directories, things should work. If they do not, please
It is the intent of the
go-gl authors to keep
gl and related packages
forward-compatible at both the API/ABI levels per go release so that you can
continue to import from this github repository. Development requiring breakage
will occur on the
dev branch, and will be merged with master when a new go
version is released.