Fix ui.go to use defer and call glfw.SwapInterval

This commit is contained in:
Hajime Hoshi 2014-12-25 18:42:39 +09:00
parent f603859b01
commit 5780e9020c

3
ui.go
View File

@ -48,6 +48,7 @@ func init() {
currentUI.run()
currentUI.use(func() {
opengl.Init()
glfw.SwapInterval(1)
})
}
@ -175,8 +176,8 @@ func (u *ui) run() {
func (u *ui) use(f func()) {
ch := make(chan struct{})
u.funcs <- func() {
defer close(ch)
f()
close(ch)
}
<-ch
}