Use dep to vendor things
This commit is contained in:
31
vendor/github.com/faiface/glhf/util.go
generated
vendored
Normal file
31
vendor/github.com/faiface/glhf/util.go
generated
vendored
Normal file
@@ -0,0 +1,31 @@
|
||||
package glhf
|
||||
|
||||
import "github.com/go-gl/gl/v3.3-core/gl"
|
||||
|
||||
type binder struct {
|
||||
restoreLoc uint32
|
||||
bindFunc func(uint32)
|
||||
|
||||
obj uint32
|
||||
|
||||
prev []uint32
|
||||
}
|
||||
|
||||
func (b *binder) bind() *binder {
|
||||
var prev int32
|
||||
gl.GetIntegerv(b.restoreLoc, &prev)
|
||||
b.prev = append(b.prev, uint32(prev))
|
||||
|
||||
if b.prev[len(b.prev)-1] != b.obj {
|
||||
b.bindFunc(b.obj)
|
||||
}
|
||||
return b
|
||||
}
|
||||
|
||||
func (b *binder) restore() *binder {
|
||||
if b.prev[len(b.prev)-1] != b.obj {
|
||||
b.bindFunc(b.prev[len(b.prev)-1])
|
||||
}
|
||||
b.prev = b.prev[:len(b.prev)-1]
|
||||
return b
|
||||
}
|
Reference in New Issue
Block a user