Support iOS for ogs-blue #7
@@ -19,8 +19,9 @@ func renderStartTimer(_ vm: RenderVM) {
|
|||||||
// Make a time mark for calculating time delta
|
// Make a time mark for calculating time delta
|
||||||
vm.startTime = CACurrentMediaTime()
|
vm.startTime = CACurrentMediaTime()
|
||||||
|
|
||||||
// Unlike macOS, UIKit never calls draw(_:) on the view, so the timer
|
// The frame is presented by eglSwapBuffers into the view's layer, not by
|
||||||
// renders each frame itself.
|
// CoreGraphics, so the timer drives the rendering itself instead of
|
||||||
|
// invalidating the view for a draw(_:) pass the way macOS does.
|
||||||
let timer = Timer(timeInterval: 1.0 / RENDER_FPS, repeats: true) { [weak vm] _ in
|
let timer = Timer(timeInterval: 1.0 / RENDER_FPS, repeats: true) { [weak vm] _ in
|
||||||
guard let vm else { return }
|
guard let vm else { return }
|
||||||
renderDraw(vm)
|
renderDraw(vm)
|
||||||
|
|||||||
Reference in new issue
Block a user