func main() { glfw.SetErrorCallback(errorCallback) if !glfw.Init() { panic("Can't init glfw!") } defer glfw.Terminate() window, err := glfw.CreateWindow(800, 640, "MyGui", nil, nil) if err != nil { panic(err) } window.MakeContextCurrent() glfw.SwapInterval(1) gl.Init() mvp := prepareModelViewProjection(800, 640) prepareScene() dt := float64(0) glfw.SetTime(dt) for !window.ShouldClose() { dt = glfw.GetTime() glfw.SetTime(0) updateScene(dt) drawScene(mvp, dt) window.SwapBuffers() glfw.PollEvents() } }
func (me *context) SetTime(t float64) { glfw.SetTime(t) }