Added geo and gl packages from gogeline and improved documentation.

This commit is contained in:
Marvin Blum
2016-05-03 21:23:50 +02:00
parent 05013370fd
commit 19731dc0e5
15 changed files with 1388 additions and 3 deletions

39
gl/vao.go Normal file
View File

@@ -0,0 +1,39 @@
package gl
import (
"github.com/go-gl/gl/v4.5-core/gl"
)
// Vertex Array Object.
type VAO struct {
id uint32
}
// Creates a new VAO.
// Bind and use VBOs for rendering later.
func NewVAO() *VAO {
vao := &VAO{}
gl.GenVertexArrays(1, &vao.id)
return vao
}
// Drops this VAO.
func (v *VAO) Drop() {
gl.DeleteVertexArrays(1, &v.id)
}
// Binds VAO for rendering.
func (v *VAO) Bind() {
gl.BindVertexArray(v.id)
}
// Unbinds.
func (v *VAO) Unbind() {
gl.BindVertexArray(0)
}
// Returns the GL ID.
func (v *VAO) GetId() uint32 {
return v.id
}