move timer

This commit is contained in:
Михаил Капелько committed 2026-10-19 17:57:54 +03:00
1 parent b068b866f0
commit fab65fb5ad
6 files changed
+29 -13

No files matched your search

+11
View File
@@ -0,0 +1,11 @@
import Foundation
func renderStartTimer(_ vm: RenderVM) {
// Schedule repaints every once in FPS seconds
let timer = Timer(timeInterval: 1.0 / RENDER_FPS, repeats: true) { [weak vm] _ in
vm?.glView.needsDisplay = true
}
vm.timer = timer
// Use .common so that holding buttons in UI does not pause this rendering timer
RunLoop.main.add(timer, forMode: .common)
}