Examples from OpenGL Programming Guide, Eighth Edition ported to the Go Programming Language.
In addition to being ported from C++ to Go, the following additional changes have been made:
- code initializing OpenGL/creating windows, has been moved to the utils package in order to reduce duplicating code that does not change between examples.
- where appropriate the examples have been modified to have
a more consistent flow from one example to the next. This involves some of the following:
- using the same style in all shaders (not usually a problem with Go).
- consistent naming of variables across all examples. If it is called "MCvertex" in one example, it should be called "MCvertex" in all examples.
- any modifications specific to the examples, should be documented in the "Notes" section of the example.
First see "Installing Examples" if you have not done so already.
$ cd $GOPATH/src/github.com/hurricanerix/gorb
$ make
mkdir -p bin
go build -o bin/ch01-triangles 01/triangles/main.go
go build -o bin/ch03-drawcommands 03/drawcommands/main.go
...
$ ./ch01-triagnles
...
-
Platform specific stuff (see sections below)
-
go get
From your terminal run the following command:
$ go get github.com/hurricanerix/gorb/...
$ sudo apt-get install git-core libgl1-mesa-dev libxrandr-dev libxcursor-dev libxinerama-dev libxi-dev
$ brew install glfw3
TODO: Figure this out...