19 lines
583 B
Swift
19 lines
583 B
Swift
import Foundation
|
|
import RaylibBridge
|
|
|
|
func renderLoadCubeModel() {
|
|
let path = Bundle.main.resourceURL!.path + RENDER_MODEL_CUBE
|
|
print("ИГР renderLCB path: '\(path)'")
|
|
sr_load_model(path)
|
|
}
|
|
|
|
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)
|
|
}
|