Skip to content

Commit

Permalink
move event polling back to 60 fps on arm Mac
Browse files Browse the repository at this point in the history
  • Loading branch information
dweymouth committed Aug 19, 2024
1 parent 6c9b9dc commit f6d6d2a
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions internal/driver/glfw/loop.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,10 +118,13 @@ func (d *gLDriver) runGL() {
go f() // don't block main, we don't have window event queue
}

// reduce background CPU by polling less frequently
// will only affect animation smoothness on ARM Mac (drawOnMainThread)
eventTick := time.NewTicker(time.Second / 30)
//eventTick := time.NewTicker(time.Second / 60)
// reduce background CPU by polling less frequently on non-ARM Mac
// would affect animation smoothness on ARM Mac (drawOnMainThread)
tickTime := time.Second / 30
if runtime.GOOS == "darwin" && runtime.GOARCH == "arm64" {
tickTime = time.Second / 60
}
eventTick := time.NewTicker(tickTime)

for {
select {
Expand Down

0 comments on commit f6d6d2a

Please sign in to comment.