20 lines
492 B
Swift
20 lines
492 B
Swift
import AppKit
|
|
import RaylibBridge
|
|
|
|
func renderDraw(_ vm: RenderVM) {
|
|
vm.glView.openGLContext?.makeCurrentContext()
|
|
raybriRender(vm.pixelSize[0], vm.pixelSize[1])
|
|
vm.glView.openGLContext?.flushBuffer()
|
|
}
|
|
|
|
func renderPixelSize(_ view: NSView) -> [Int32] {
|
|
let backing = view.convertToBacking(view.bounds)
|
|
let w = Int32(max(1, backing.width))
|
|
let h = Int32(max(1, backing.height))
|
|
return [w, h]
|
|
}
|
|
|
|
func renderRecreateSurface(_ vm: RenderVM) {
|
|
// No-op on macOS
|
|
}
|