Permalink
Browse files

Simplify SwapBuffers requestAnimationFrame sync.

There's still room for improvement, but at least this doesn't create as
many goroutines.
  • Loading branch information...
dmitshur committed Oct 18, 2017
1 parent 7ec5fcc commit 7dec05603e063fb88a9e0b2aa404ae840b9e911c
Showing with 2 additions and 4 deletions.
  1. +2 −4 browser.go
View
@@ -471,12 +471,10 @@ func (w *Window) SwapBuffers() error {
return nil
}
var animationFrameChan = make(chan struct{})
var animationFrameChan = make(chan struct{}, 1)
func animationFrame() {
go func() {
animationFrameChan <- struct{}{}
}()
animationFrameChan <- struct{}{}
}
func (w *Window) GetCursorPos() (x, y float64) {

0 comments on commit 7dec056

Please sign in to comment.