A rewrite of my favorite multimedia library, SFML, in Google's Golang
Having installed go with proper path, you will additionally need some Open GL headers and the glfw3 go package. The required headers are glfw3 and glew. Make sure all the C libraries are dynamically linked, as CGO can't handle static libraries.
- Mac
brew tap homebrew/versions
brew install glfw3
brew install glew
- Windows
Detailed tutorial coming soon... You'll need to build and install glew and glfw using CMAKE. Make sure they're dynamically linked (with dlls)
- Linux
Install opengl, glew, and glfw from whichever package manager your distribution comes with
Then you can install the Go bindings for OpenGL and gflw3 using go get:
go get github.com/go-gl/gl
go get github.com/go-gl/glfw3
There's some known issues building Go's glfw bindings though. Here's the workaround:
cd $GOPATH/src/github.com/go-gl/glfw3
CGO_CFLAGS=-ftrack-macro-expansion=0 go install
Note: mac users - you may need to use llvm-gcc instead of clang to build glfw, in shell, before running go get, type:
export CC=llvm-gcc
If all dependencies have been installed without error, you can simply use go get to grab gosfml:
go get github.com/tedsta/gosfml
Check out example usages from the examples folder!