try my way

This commit is contained in:
Михаил Капелько committed 2026-10-22 18:33:09 +03:00
1 parent 6fecc1e95e
commit fa1cd053c8
16 files changed
+521 -2

No files matched your search

+17
View File
@@ -0,0 +1,17 @@
import QuartzCore
import UIKit
// Render a single frame. The timer calls this directly: an EGL/ANGLE surface
// presents into the view's layer, so there is no draw(_:) / needsDisplay pass
// like in the NSOpenGLView on macOS.
func renderDraw(_ vm: RenderVM) {
raybri_ios_render(CACurrentMediaTime() - vm.startTime)
}
// Backing-pixel size of the view, which is what EGL/ANGLE renders into.
func renderPixelSize(_ view: UIView) -> [Int32] {
let scale = view.contentScaleFactor
let w = Int32(max(1, (view.bounds.width * scale).rounded()))
let h = Int32(max(1, (view.bounds.height * scale).rounded()))
return [w, h]
}