47 lines
1.3 KiB
Swift
47 lines
1.3 KiB
Swift
import Combine
|
|
import Foundation
|
|
|
|
// On iOS the renderer is the prebuilt raylib framework's own full-screen
|
|
// window (see components/render/ios/renderIOS.mm: ios_ready/ios_update/
|
|
// ios_destroy). The macOS render component is not used there, but the
|
|
// generated dialect.swift still refers to RenderComponent/RenderVM and to the
|
|
// renderInit/renderStartTimer/renderLoadCubeModel/renderDeinit oneliners, so
|
|
// we provide inert counterparts to keep the dialect compiling.
|
|
//
|
|
// The real work happens in renderIOS.mm, which talks to the very same
|
|
// raybri_* bridge functions these stubs would call on macOS.
|
|
|
|
final class RenderVM: ObservableObject {
|
|
var didPrepareGL = false
|
|
var pixelSize = [Int32]()
|
|
var startTime: CFTimeInterval = 0
|
|
|
|
static private(set) weak var shared: RenderVM?
|
|
|
|
init() {
|
|
Self.shared = self
|
|
}
|
|
}
|
|
|
|
class RenderComponent {
|
|
let ctrl = DialectController(RenderContext())
|
|
static private(set) weak var singleton: RenderComponent?
|
|
|
|
init() {
|
|
Self.singleton = self
|
|
renderRegisterShoulds(ctrl)
|
|
}
|
|
|
|
func setup() {
|
|
renderSet(F.didSetup, true)
|
|
}
|
|
}
|
|
|
|
func renderInit(_ vm: RenderVM) {}
|
|
|
|
func renderStartTimer(_ vm: RenderVM) {}
|
|
|
|
func renderLoadCubeModel(_ vm: RenderVM) {}
|
|
|
|
func renderDeinit(_ vm: RenderVM) {}
|