mirror of
https://github.com/ichmagmaus111/ghostgram.git
synced 2026-11-11 17:49:43 +01:00
Ghostgram for iOS, rebuilt from scratch on Telegram iOS 13.0. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
29 lines
692 B
Swift
29 lines
692 B
Swift
import Foundation
|
|
import UIKit
|
|
import Display
|
|
import MetalKit
|
|
|
|
private final class BundleMarker: NSObject {
|
|
}
|
|
|
|
private var metalLibraryValue: MTLLibrary?
|
|
func metalLibrary(device: MTLDevice) -> MTLLibrary? {
|
|
if let metalLibraryValue {
|
|
return metalLibraryValue
|
|
}
|
|
|
|
let mainBundle = Bundle(for: BundleMarker.self)
|
|
guard let path = mainBundle.path(forResource: "CameraScreenBundle", ofType: "bundle") else {
|
|
return nil
|
|
}
|
|
guard let bundle = Bundle(path: path) else {
|
|
return nil
|
|
}
|
|
guard let library = try? device.makeDefaultLibrary(bundle: bundle) else {
|
|
return nil
|
|
}
|
|
|
|
metalLibraryValue = library
|
|
return library
|
|
}
|